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. prints its parameter to the console






2. Function to open or read a file






3. multiply AND assignment operator






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






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






6. Function to write something to a file






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






8. Argument variable






9. modulo






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






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






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






13. Adds a new line character






14. Adds something to a variable






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






16. deletes an item from a list






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






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






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






20. exponent AND assignment operator






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






22. multiply AND assignment operator






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






24. turns an object into a string






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






26. Command to print to the screen






27. adds an item to a list






28. prints its parameter to the console






29. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






30. Create a variable.






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






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






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






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






35. Function to read the contents of a file






36. Less than or equal to symbol






37. Prevents a runtime error from stopping the program.






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






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






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






41. Function to write something to a file






42. empties the file






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






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






45. adds an item to a list






46. A statement that breaks out of a loop.






47. Less than or equal to symbol






48. Reads just one line of a text file.






49. Less than symbol






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