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. This statement causes an exception.






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






3. Symbol to subtract things from each other






4. Less than symbol






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






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






7. Less than or equal to symbol






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






9. Argument variable






10. prints its parameter to the console






11. assignment operator






12. empties the file






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






14. Adds a new line character






15. floor division AND assignment operator






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






17. An operator to check whether two variables refer to the same object.






18. multiply AND assignment operator






19. This statement exits a function. The remaining lines of the function are not executed.






20. Symbol to add things together






21. Function to write something to a file






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






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






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






25. exponent AND assignment operator






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






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






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






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






30. turns an object into a string






31. Prevents a runtime error from stopping the program.






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






33. Symbol to subtract things from each other






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






35. absolute value






36. unction to read one line of a file






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






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






39. floor division






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






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






42. End header line.






43. Symbol to multiply things






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






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






46. turns an object into an integer






47. modulus AND assignment operator






48. Symbol used to create comments






49. Argument variable






50. Function to open or read a file