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. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111






2. Less than or equal to symbol






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






4. turns an object into a string






5. subtract AND assignment operator






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






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






8. multiply AND assignment operator






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






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






11. Reads just one line of a text file.






12. unction to read one line of a file






13. End header line.






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






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






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






17. modulus AND assignment operator






18. Adds something to a variable






19. turns an object into a string






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






21. absolute value






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






23. Create a variable.






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






25. modulo






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






27. Symbol to add things together






28. Symbol to multiply things






29. Function to write something to a file






30. add AND assignment operator






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






32. deletes an item from a list






33. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






34. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






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






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






37. adds an item to a list






38. exponentiation






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






40. Greater than symbol






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






42. adds an item to a list






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






44. square root






45. floor division






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






47. Command to print to the screen






48. Prevents a runtime error from stopping the program.






49. The extension for Python scripts






50. Greater than symbol