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. End header line.






2. multiply AND assignment operator






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






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






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






6. Function to write something to a file






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






8. Greater than symbol






9. Adds a new line character






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






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






12. Symbol to subtract things from each other






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






14. square root






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






16. adds an item to a list






17. Function to read the contents of a file






18. divide AND assignment operator






19. modulo






20. Symbol to subtract things from each other






21. Less than symbol






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






23. Less than symbol






24. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.






25. Adds something to a variable






26. Argument variable






27. Prevents a runtime error from stopping the program.






28. turns an object into a string






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






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






31. turns an object into a string






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






33. modulus AND assignment operator






34. Command to print to the screen






35. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.






36. divide AND assignment operator






37. single line comment






38. Adds something to a variable






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






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






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






42. exponent AND assignment operator






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






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






45. exponentiation






46. prints its parameter to the console






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






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






49. floor division AND assignment operator






50. add AND assignment operator