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. Less than symbol






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






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






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






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






6. adds an item to a list






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






8. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






10. floor division






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






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






13. absolute value






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






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






16. adds an item to a list






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






18. writes stuff to the file






19. Less than or equal to symbol






20. Symbol to multiply things






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






22. turns an object into a string






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






24. modulo






25. turns an object into a string






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






27. deletes an item from a list






28. multiply AND assignment operator






29. divide AND assignment operator






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






31. Less than or equal to symbol






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






33. Greater than symbol






34. Function to write something to a file






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






36. A statement that breaks out of a loop.






37. floor division AND assignment operator






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






39. Symbol to add things together






40. exponent AND assignment operator






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






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






43. empties the file






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






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






46. Adds a new line character






47. Command to print to the screen






48. An operator to check whether two variables refer to the same object.






49. modulus AND assignment operator






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