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 keyword attempts to do something that would cause the program to crash if it were not for this statement.






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






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






4. Adds something to a variable






5. absolute value






6. Function to open or read a file






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






8. floor division AND assignment operator






9. Command to print to the screen






10. deletes an item from a list






11. writes stuff to the file






12. unction to read one line of a file






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






14. Symbol used to create comments






15. Symbol to multiply things






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






17. multiply AND assignment operator






18. exponentiation






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






20. Reads the contents of the file you can assign the result to a variable.






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






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






23. exponent AND assignment operator






24. floor division AND assignment operator






25. absolute value






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






27. Writes stuff to the file.






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






29. A statement that breaks out of a loop.






30. exponentiation






31. adds an item to a list






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






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






34. modulus AND assignment operator






35. Adds a new line character






36. Adds a new line character






37. Function to read the contents of a file






38. modulus AND assignment operator






39. Symbol to subtract things from each other






40. End header line.






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






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






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






44. empties the file






45. Argument variable






46. floor division






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






48. Prevents a runtime error from stopping the program.






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






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