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. Adds a new line character






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






3. Argument variable






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






5. Create a variable.






6. Function to open or read a file






7. Less than or equal to symbol






8. adds an item to a list






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






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






11. unction to read one line of a file






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






13. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






14. Adds something to a variable






15. turns an object into an integer






16. Adds something to a variable






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






18. Function to read the contents of a file






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






20. assignment operator






21. add AND assignment operator






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






23. Greater than symbol






24. Function to read the contents of a file






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






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






27. This statement causes an exception.






28. turns an object into a string






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






30. Command to print to the screen






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






32. single line comment






33. Writes stuff to the file.






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






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






36. deletes an item from a list






37. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






39. Symbol to multiply things






40. subtract AND assignment operator






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






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






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






44. floor division AND assignment operator






45. absolute value






46. exponentiation






47. Greater than or equal symbol.






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






49. Symbol to subtract things from each other






50. assignment operator