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 keyword beginning a header that will create a new function.






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






3. adds an item to a list






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






5. floor division






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






7. Less than symbol






8. modulus AND assignment operator






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






10. single line comment






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






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






13. exponentiation






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






15. turns an object into a string






16. deletes an item from a list






17. This keyword in the body of a conditional - gives an alternative execution.






18. A statement that breaks out of a loop.






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






20. Writes stuff to the file.






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






22. Adds something to a variable






23. Symbol used to create comments






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






25. Symbol to subtract things from each other






26. subtract AND assignment operator






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






28. Greater than symbol






29. sets the file's current position






30. Adds a new line character






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






32. adds an item to a list






33. exponent AND assignment operator






34. Create a variable.






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






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






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






38. Function to read the contents of a file






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






40. Argument variable






41. add AND assignment operator






42. prints its parameter to the console






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






44. turns an object into a string






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






46. This keyword in the body of a conditional - gives an alternative execution.






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






48. Function to write something to a file






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






50. unction to read one line of a file