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 logical operator which compares two operands and produces True if they are equal and False otherwise






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






3. Greater than symbol






4. Symbol used to create comments






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






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






7. add AND assignment operator






8. subtract AND assignment operator






9. subtract AND assignment operator






10. assignment operator






11. multiply AND assignment operator






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






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






14. turns an object into an integer






15. Symbol used to create comments






16. deletes an item from a list






17. turns an object into a string






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






19. Prevents a runtime error from stopping the program.






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






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






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






23. Writes stuff to the file.






24. modulus AND assignment operator






25. floor division AND assignment operator






26. Turns a line into a comment instead of executable code.






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






28. divide AND assignment operator






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






30. deletes an item from a list






31. Argument variable






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






33. floor division






34. Greater than or equal symbol.






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






36. Function to read the contents of a file






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






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






39. Symbol to subtract things from each other






40. single line comment






41. Command to print to the screen






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






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






44. A statement that displays a value on the screen.






45. Function to open or read a file






46. End header line.






47. Function to write something to a file






48. square root






49. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.






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