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 write something to a file






2. assignment operator






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






4. unction to read one line of a file






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






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






7. single line comment






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






9. exponent AND assignment operator






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






11. Create a variable.






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






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






14. Symbol to multiply things






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






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






17. sets the file's current position






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






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






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






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






22. subtract AND assignment operator






23. Less than or equal to symbol






24. Function to open or read a file






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






26. Less than symbol






27. exponentiation






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






29. This statement causes an exception.






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






31. floor division AND assignment operator






32. An operator to check whether two variables refer to the same object.






33. Writes stuff to the file.






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






35. Symbol to add things together






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






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






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






39. subtract AND assignment operator






40. exponentiation






41. absolute value






42. floor division






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






44. The extension for Python scripts






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






46. Command to print to the screen






47. Greater than or equal symbol.






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






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






50. unction to read one line of a file