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






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






4. rounds a number to the number of decimal points you choose






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






6. Symbol used to create comments






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






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






9. Function to write something to a file






10. Symbol to multiply things






11. Function to write something to a file






12. Argument variable






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






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






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






16. multiply AND assignment operator






17. exponent AND assignment operator






18. subtract AND assignment operator






19. Symbol to add things together






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






21. Argument variable






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






23. Greater than symbol






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






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






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






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






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






29. divide AND assignment operator






30. Less than symbol






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






32. A keyword that does nothing but fill space to indicate code which will be written later.






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






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






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






36. End header line.






37. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






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






39. A statement that breaks out of a loop.






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






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






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






43. Adds something to a variable






44. Command to print to the screen






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






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






47. floor division






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






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






50. Symbol to multiply things