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. The extension for Python scripts






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






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






4. exponent AND assignment operator






5. sets the file's current position






6. prints its parameter to the console






7. This keyword begins a header for a body that repeats until the condition is no longer true.






8. deletes an item from a list






9. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






10. Function to read the contents of a file






11. single line comment






12. Less than symbol






13. A built-in function that converts its argument to a string.






14. Function to write something to a file






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






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






17. Adds a new line character






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






19. Symbol to subtract things from each other






20. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






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






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






23. floor division






24. assignment operator






25. Command to print to the screen






26. subtract AND assignment operator






27. floor division AND assignment operator






28. reads just one line of a text file & keeps track of where in the file you're at






29. turns an object into a string






30. square root






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






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






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






34. Create a variable.






35. Prevents a runtime error from stopping the program.






36. An operator that removes a value from a list.






37. A statement that displays a value on the screen.






38. Less than or equal to symbol






39. Writes stuff to the file.






40. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






41. adds an item to a list






42. Function to write something to a file






43. multiply AND assignment operator






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






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






46. modulus AND assignment operator






47. Prints a string to the screen which is a signed decimal.






48. floor division AND assignment operator






49. Symbol to add things together






50. turns an object into an integer