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. Reads the contents of the file you can assign the result to a variable.






2. Command to print to the screen






3. Greater than or equal symbol.






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






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






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






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






8. prints its parameter to the console






9. add AND assignment operator






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






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






12. divide AND assignment operator






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






14. Symbol to multiply things






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






16. assignment operator






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






18. This keyword begins the simplest form of a conditional statement.






19. Symbol to add things together






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






21. sets the file's current position






22. Symbol to add things together






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






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






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






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






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






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






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






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






31. multiply AND assignment operator






32. The extension for Python scripts






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






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






35. Adds a new line character






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






37. This keyword begins the simplest form of a conditional statement.






38. Writes stuff to the file.






39. Adds something to a variable






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






41. Function to open or read a file






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






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






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






45. floor division AND assignment operator






46. Symbol used to create comments






47. End header line.






48. assignment operator






49. subtract AND assignment operator






50. deletes an item from a list