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. This statement causes an exception.






2. Function to open or read a file






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






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






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






6. single line comment






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






8. exponentiation






9. Create a variable.






10. Function to write something to a file






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






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






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






14. Symbol to multiply things






15. divide AND assignment operator






16. Symbol to multiply things






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






18. Argument variable






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






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






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






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






23. turns an object into an integer






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






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






26. Prevents a runtime error from stopping the program.






27. modulus AND assignment operator






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






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






30. turns an object into an integer






31. Symbol to subtract things from each other






32. Symbol to subtract things from each other






33. A logical operator which negates an expression so that it returns a value of True if the expression is false.






34. modulo






35. Less than or equal to symbol






36. add AND assignment operator






37. unction to read one line of a file






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






39. subtract AND assignment operator






40. unction to read one line of a file






41. deletes an item from a list






42. modulo






43. rounds a number to the number of decimal points you choose






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






45. exponent AND assignment operator






46. floor division AND assignment operator






47. exponent AND assignment operator






48. Symbol to add things together






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






50. deletes an item from a list