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. Prevents a runtime error from stopping the program.






2. Symbol to subtract things from each other






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






4. Symbol used to create comments






5. add AND assignment operator






6. unction to read one line of a file






7. Less than symbol






8. Create a variable.






9. The extension for Python scripts






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






11. Greater than or equal symbol.






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






13. Less than or equal to symbol






14. Command to print to the screen






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






16. Adds a new line character






17. Greater than or equal symbol.






18. Greater than symbol






19. prints its parameter to the console






20. writes stuff to the file






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






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






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






24. The extension for Python scripts






25. prints its parameter to the console






26. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.






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






28. Argument variable






29. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






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






31. add AND assignment operator






32. Function to write something to a file






33. Function to read the contents of a file






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






35. turns an object into an integer






36. single line comment






37. floor division AND assignment operator






38. sets the file's current position






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






40. assignment operator






41. Reads just one line of a text file.






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






43. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






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






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






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






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






49. adds an item to a list






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