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. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101






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






4. modulus AND assignment operator






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






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






7. Symbol to add things together






8. Less than or equal to symbol






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






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






11. divide AND assignment operator






12. Symbol to subtract things from each other






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






14. Adds a new line character






15. Symbol to multiply things






16. turns an object into a string






17. exponent AND assignment operator






18. multiply AND assignment operator






19. Argument variable






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






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






22. Function to open or read a file






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






24. Reads just one line of a text file.






25. Symbol to add things together






26. Command to print to the screen






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






28. modulo






29. single line comment






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






31. turns an object into an integer






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






33. subtract AND assignment operator






34. deletes an item from a list






35. empties the file






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






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






38. reads just one line of a text file & keeps track of where in the file you're at






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






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






41. prints its parameter to the console






42. A statement that ends the current iteration of a loop but continues looping.






43. divide AND assignment operator






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






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






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






47. exponent AND assignment operator






48. Argument variable






49. Adds something to a variable






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