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






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






3. Function to write something to a file






4. unction to read one line of a file






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






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






7. Less than symbol






8. exponentiation






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






10. deletes an item from a list






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






12. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






13. ,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.






14. Symbol to subtract things from each other






15. adds an item to a list






16. sets the file's current position






17. A statement that ends the current iteration of a loop but continues looping.






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






19. Symbol to add things together






20. Symbol used to create comments






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






22. turns an object into a string






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






24. modulus AND assignment operator






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






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






27. turns an object into an integer






28. Create a variable.






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






30. assignment operator






31. writes stuff to the file






32. The extension for Python scripts






33. floor division






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






35. absolute value






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






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






38. Adds a new line character






39. This keyword begins a header for a body that repeats until the condition is no longer true.






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






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






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






43. The extension for Python scripts






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






45. unction to read one line of a file






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






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






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






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






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