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. Writes stuff to the file.






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






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






4. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






5. Less than or equal to symbol






6. Symbol to subtract things from each other






7. Symbol used to create comments






8. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101






9. The extension for Python scripts






10. Prevents a runtime error from stopping the program.






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






12. 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






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






14. rounds a number to the number of decimal points you choose






15. add AND assignment operator






16. A logical operator which returns a value of True if either of the conditions is true.






17. subtract AND assignment operator






18. End header line.






19. Function to close a file - it will not be able to be used again unless the file is opened.






20. Command to print to the screen






21. exponent AND assignment operator






22. Symbol used to create comments






23. Symbol to multiply things






24. Symbol to divide by the number to the right of the symbol






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






26. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






27. The extension for Python scripts






28. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






29. Adds something to a variable






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






31. modulo






32. Adds a new line character






33. turns an object into an integer






34. Less than symbol






35. multiply AND assignment operator






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






37. Modulus operator. It's the remainder after division






38. add AND assignment operator






39. modulus AND assignment operator






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






41. rounds a number to the number of decimal points you choose






42. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






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






44. turns an object into a string






45. A logical operator which compares two operands and produces True if they are equal and False otherwise






46. empties the file






47. Greater than or equal symbol.






48. floor division AND assignment operator






49. square root






50. prints its parameter to the console