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 close a file - it will not be able to be used again unless the file is opened.






2. assignment operator






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






4. deletes an item from a list






5. A statement that breaks out of a loop.






6. This keyword in the body of a conditional allows chained conditionals.






7. Function to read the contents of a file






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






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






10. Function to write something to a file






11. subtract AND assignment operator






12. Command to print to the screen






13. Adds a new line character






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






15. deletes an item from a list






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






17. square root






18. Greater than symbol






19. single line comment






20. Adds a new line character






21. adds an item to a list






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






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






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






25. divide AND assignment operator






26. exponent AND assignment operator






27. Adds something to a variable






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






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






30. add AND assignment operator






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






32. modulus AND assignment operator






33. Argument variable






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






35. floor division AND assignment operator






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






37. empties the file






38. exponent AND assignment operator






39. Less than symbol






40. The extension for Python scripts






41. Symbol to subtract things from each other






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






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






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






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






46. adds an item to a list






47. A logical operator which compares two operands and produces True if they are equal and False otherwise






48. Less than symbol






49. multiply AND assignment operator






50. End header line.