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. rounds a number to the number of decimal points you choose






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






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






4. multiply AND assignment operator






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






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






7. unction to read one line of a file






8. Greater than or equal symbol.






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






10. returns the length of a string (number of characters)






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






12. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






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






14. floor division AND assignment operator






15. divide AND assignment operator






16. floor division






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






18. sets the file's current position






19. turns an object into an integer






20. The extension for Python scripts






21. floor division






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






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






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






25. Symbol to multiply things






26. Adds a new line character






27. floor division AND assignment operator






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






29. Symbol to subtract things from each other






30. add AND assignment operator






31. Create a variable.






32. prints its parameter to the console






33. Less than symbol






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






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






36. Argument variable






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






38. Less than or equal to symbol






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






40. empties the file






41. Greater than or equal symbol.






42. Symbol used to create comments






43. Writes stuff to the file.






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






45. single line comment






46. deletes an item from a list






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






48. This statement exits a function. The remaining lines of the function are not executed.






49. Function to write something to a file






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