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. assignment operator






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






3. divide AND assignment operator






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






5. square root






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






7. A built-in function that converts its argument to a string.






8. Symbol to multiply things






9. Symbol used to create comments






10. floor division AND assignment operator






11. exponent AND assignment operator






12. Greater than symbol






13. Symbol used to create comments






14. Create a variable.






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






16. A data type for representing numbers with fractional values.






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






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






19. Function to read the contents of a file






20. Adds a new line character






21. Adds something to a variable






22. End header line.






23. Command to print to the screen






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






25. modulo






26. modulus AND assignment operator






27. A statement that assigns a value to a variable.






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






29. Greater than symbol






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






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






32. Less than or equal to symbol






33. adds an item to a list






34. floor division






35. adds an item to a list






36. absolute value






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






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






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






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






41. prints its parameter to the console






42. The extension for Python scripts






43. asks the user for a response and returns that response






44. This statement causes an exception.






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






46. Symbol to add things together






47. Function to write something to a file






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






49. deletes an item from a list






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