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. Function to open or read a file






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






3. writes stuff to the file






4. Adds a new line character






5. absolute value






6. End header line.






7. add AND assignment operator






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






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






10. multiply AND assignment operator






11. Prevents a runtime error from stopping the program.






12. turns an object into a string






13. single line comment






14. A keyword that does nothing but fill space to indicate code which will be written later.






15. floor division






16. Function to open or read a file






17. modulo






18. turns an object into an integer






19. modulo






20. Less than symbol






21. turns an object into a string






22. Argument variable






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






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






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






26. Function to read the contents of a file






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






28. multiply AND assignment operator






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






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






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






32. This statement causes an exception.






33. modulus AND assignment operator






34. exponent AND assignment operator






35. 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).






36. Function to write something to a file






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






38. subtract AND assignment operator






39. The extension for Python scripts






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






41. Adds a new line character






42. prints its parameter to the console






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






44. empties the file






45. deletes an item from a list






46. adds an item to a list






47. sets the file's current position






48. floor division






49. exponentiation






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