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. This keyword begins a header for a body that repeats until the condition is no longer true.






3. turns an object into an integer






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






5. exponentiation






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






7. prints its parameter to the console






8. absolute value






9. Greater than or equal symbol.






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






11. Symbol to multiply things






12. floor division AND assignment operator






13. End header line.






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






15. Greater than or equal symbol.






16. Writes stuff to the file.






17. modulus AND assignment operator






18. deletes an item from a list






19. Create a variable.






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






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






22. deletes an item from a list






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






24. Greater than symbol






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






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






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






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






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






30. square root






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






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






33. exponent AND assignment operator






34. Symbol to subtract things from each other






35. turns an object into an integer






36. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






37. modulo






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






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






40. adds an item to a list






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






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






43. unction to read one line of a file






44. adds an item to a list






45. modulus AND assignment operator






46. The extension for Python scripts






47. Less than or equal to symbol






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






49. subtract AND assignment operator






50. Less than symbol