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. A keyword that does nothing but fill space to indicate code which will be written later.






2. The extension for Python scripts






3. modulus AND assignment operator






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






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






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






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






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






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






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






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






12. Symbol to multiply things






13. turns an object into a string






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






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






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






17. This statement causes an exception.






18. Symbol to add things together






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






20. Less than symbol






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






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






23. Command to print to the screen






24. floor division AND assignment operator






25. Symbol to add things together






26. Adds something to a variable






27. assignment operator






28. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






29. modulo






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






31. Greater than or equal symbol.






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






33. floor division






34. Less than symbol






35. Symbol to multiply things






36. Adds a new line character






37. Create a variable.






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






39. Symbol to subtract things from each other






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






41. Less than or equal to symbol






42. multiply AND assignment operator






43. sets the file's current position






44. Greater than or equal symbol.






45. absolute value






46. divide AND assignment operator






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






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






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






50. adds an item to a list