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






2. Argument variable






3. The extension for Python scripts






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






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






6. exponent AND assignment operator






7. A built-in function that converts integers and strings to floating-point numbers.






8. Less than symbol






9. floor division






10. Function to open or read a file






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






12. floor division AND assignment operator






13. Prevents a runtime error from stopping the program.






14. Create a variable.






15. A data type for representing numbers with fractional values.






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






17. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






18. This statement exits a function. The remaining lines of the function are not executed.






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






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






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






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






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






24. prints its parameter to the console






25. Command to print to the screen






26. sets the file's current position






27. This statement causes an exception.






28. Function to write something to a file






29. modulus AND assignment operator






30. add AND assignment operator






31. Symbol to add things together






32. multiply AND assignment operator






33. assignment operator






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






35. Create a variable.






36. assignment operator






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






38. modulus AND assignment operator






39. turns an object into an integer






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






41. Symbol used to create comments






42. prints its parameter to the console






43. adds an item to a list






44. Function to read the contents of a file






45. Function to open or read a file






46. Command to print to the screen






47. exponentiation






48. floor division






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






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