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. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






2. Reads just one line of a text file.






3. Command to print to the screen






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






5. Function to open or read a file






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






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






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






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






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






11. absolute value






12. Symbol used to create comments






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






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






15. assignment operator






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






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






18. exponent AND assignment operator






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






20. Create a variable.






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






22. absolute value






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






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






25. Function to write something to a file






26. exponentiation






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






28. deletes an item from a list






29. empties the file






30. Less than or equal to symbol






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






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






33. Symbol to multiply things






34. floor division AND assignment operator






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






36. A built-in function that converts integers and strings to floating-point numbers.






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






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






39. Greater than symbol






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






41. Adds a new line character






42. deletes an item from a list






43. exponentiation






44. Argument variable






45. Symbol to add things together






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






47. unction to read one line of a file






48. Function to read the contents of a file






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






50. multiply AND assignment operator