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 a string to the screen which will be Unicode.






2. multiply AND assignment operator






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






4. Symbol to subtract things from each other






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






6. subtract AND assignment operator






7. A logical operator which returns a value of True if either of the conditions is true.






8. This statement causes an exception.






9. Argument variable






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






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






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






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






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






15. Adds something to a variable






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






17. absolute value






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






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






20. Less than or equal to symbol






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






22. reads just one line of a text file & keeps track of where in the file you're at






23. Less than symbol






24. add AND assignment operator






25. turns an object into a string






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






27. Adds a new line character






28. single line comment






29. prints its parameter to the console






30. Command to print to the screen






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






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






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






34. adds an item to a list






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






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






37. exponentiation






38. turns an object into an integer






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






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






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






42. exponent AND assignment operator






43. Function to open or read a file






44. unction to read one line of a file






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






46. Symbol to add things together






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






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






49. Less than or equal to symbol






50. A statement that ends the current iteration of a loop but continues looping.