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. Symbol to subtract things from each other






3. Symbol to multiply things






4. Turns a line into a comment instead of executable code.






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






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






7. absolute value






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






9. assignment operator






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






11. Greater than symbol






12. Reads the contents of the file you can assign the result to a variable.






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






14. Create a variable.






15. add AND assignment operator






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






17. Symbol to add things together






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






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






20. empties the file






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






22. adds an item to a list






23. The extension for Python scripts






24. modulo






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






26. floor division AND assignment operator






27. modulo






28. Symbol to subtract things from each other






29. Argument variable






30. End header line.






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






32. single line comment






33. exponent AND assignment operator






34. Function to write something to a file






35. deletes an item from a list






36. Less than symbol






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






38. Writes stuff to the file.






39. Symbol to multiply things






40. End header line.






41. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






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






43. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






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






45. multiply AND assignment operator






46. Command to print to the screen






47. turns an object into a string






48. divide AND assignment operator






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






50. divide AND assignment operator