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 string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






3. Greater than or equal symbol.






4. Function to close a file - it will not be able to be used again unless the file is opened.






5. Symbol to subtract things from each other






6. multiply AND assignment operator






7. modulo






8. Less than or equal to symbol






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






10. Function to write something to a file






11. absolute value






12. Function to read the contents of a file






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






14. Command to print to the screen






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






16. Greater than symbol






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






18. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






19. Function to write something to a file






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






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






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






23. absolute value






24. square root






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






26. add AND assignment operator






27. Function to close a file - it will not be able to be used again unless the file is opened.






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






29. divide AND assignment operator






30. unction to read one line of a file






31. Create a variable.






32. Argument variable






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






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






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






36. deletes an item from a list






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. Symbol to multiply things






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






40. subtract AND assignment operator






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






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






43. divide AND assignment operator






44. exponentiation






45. Prevents a runtime error from stopping the program.






46. Symbol to add things together






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






48. A statement that breaks out of a loop.






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






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