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. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.






2. subtract AND assignment operator






3. The extension for Python scripts






4. add AND assignment operator






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






6. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






7. Less than or equal to symbol






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






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






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






11. prints its parameter to the console






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






13. divide AND assignment operator






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






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






16. Greater than symbol






17. Prints a string to the screen which is a signed decimal.






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






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






20. Less than or equal to symbol






21. Less than symbol






22. Function to write something to a file






23. modulus AND assignment operator






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






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






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






27. floor division






28. subtract AND assignment operator






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






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






31. Adds a new line character






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






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






34. A statement that breaks out of a loop.






35. empties the file






36. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.






37. Symbol to add things together






38. absolute value






39. exponent AND assignment operator






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






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






42. Symbol used to create comments






43. Function to open or read a file






44. unction to read one line of a file






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






46. Adds something to a variable






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






48. modulo






49. exponentiation






50. adds an item to a list