Test your basic knowledge |

Basic Python Programming

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Symbol to divide by the number to the right of the symbol






2. This keyword begins the simplest form of a conditional statement.






3. Empties the file - watch out if you care about the file.






4. Prints a string to the screen which will be Unicode.






5. Symbol to subtract things from each other






6. Command to print to the screen






7. turns an object into an integer






8. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111






9. turns an object into an integer






10. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






11. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






12. Adds a new line character






13. sets the file's current position






14. square root






15. Less than or equal to symbol






16. divide AND assignment operator






17. inserts an item inside a list at a certain index






18. Function to empty the contents of a file - no recovery is possible






19. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






20. floor division AND assignment operator






21. The keyword beginning a header that will create a new function.






22. This keyword in the body of a conditional allows chained conditionals.






23. asks the user for a response and returns that response






24. Turns a line into a comment instead of executable code.






25. subtract AND assignment operator






26. adds an item to a list






27. Prints a string to the screen which is converted using repr()






28. square root






29. Where the parameters go. A necessary punctuation after any function even if it's empty.






30. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






31. Argument variable






32. Prevents a runtime error from stopping the program.






33. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






34. deletes an item from a list






35. Reads the contents of the file you can assign the result to a variable.






36. End header line.






37. A built-in function that converts integers and strings to floating-point numbers.






38. returns the length of a string (number of characters)






39. The keyword beginning a header that will create a loop.






40. deletes an item from a list






41. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






42. turns an object into a string






43. A logical operator which requires two expressions to both be true.






44. exponentiation






45. This statement exits a function. The remaining lines of the function are not executed.






46. The extension for Python scripts






47. Function to write something to a file






48. Symbol to add things together






49. Create a variable.






50. This statement causes an exception.