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. Symbol used to create comments






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






3. Prevents a runtime error from stopping the program.






4. Function to write something to a file






5. Symbol to subtract things from each other






6. modulus AND assignment operator






7. An operator that removes a value from a list.






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






9. Prints a string to the screen which is a signed decimal.






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






11. deletes an item from a list






12. floor division AND assignment operator






13. turns an object into an integer






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






15. add AND assignment operator






16. A statement that assigns a value to a variable.






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






18. turns an object into a string






19. Adds a new line character






20. Adds something to a variable






21. absolute value






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






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






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






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






26. End header line.






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






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






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






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






31. divide AND assignment operator






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






33. Less than or equal to symbol






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






35. Argument variable






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






37. Greater than or equal symbol.






38. Command to print to the screen






39. floor division AND assignment operator






40. exponentiation






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






42. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






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






44. The extension for Python scripts






45. prints its parameter to the console






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






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






48. multiply AND assignment operator






49. divide AND assignment operator






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