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. A statement that displays a value on the screen.






2. The extension for Python scripts






3. 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).






4. modulus AND assignment operator






5. floor division AND assignment operator






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






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






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






9. unction to read one line of a file






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






11. multiply AND assignment operator






12. subtract AND assignment operator






13. exponent AND assignment operator






14. This statement causes an exception.






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






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






17. Less than symbol






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






19. sets the file's current position






20. square root






21. Greater than or equal symbol.






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






23. modulus AND assignment operator






24. Symbol to subtract things from each other






25. prints its parameter to the console






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






27. adds an item to a list






28. add AND assignment operator






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






30. Less than or equal to symbol






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






32. turns an object into an integer






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






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






35. modulo






36. deletes an item from a list






37. divide AND assignment operator






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






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






40. Argument variable






41. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






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






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






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






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






46. Create a variable.






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






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






49. Greater than symbol






50. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.