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 creates a new class object which is a user-defined type - like a factory for creating objects.






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






3. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






4. Function to open or read a file






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






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






7. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






8. empties the file






9. floor division






10. modulus AND assignment operator






11. returns the length of a string (number of characters)






12. assignment operator






13. Symbol used to create comments






14. A data type for representing numbers with fractional values.






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






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






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






18. Symbol used to create comments






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






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






21. Symbol to add things together






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






23. Function to read the contents of a file






24. floor division






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






26. Function to open or read a file






27. deletes an item from a list






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






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






30. add AND assignment operator






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






32. Function to write something to a file






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






34. End header line.






35. modulo






36. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






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






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






39. assignment operator






40. Less than or equal to symbol






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






42. unction to read one line of a file






43. subtract AND assignment operator






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






45. Create a variable.






46. returns the length of a string (number of characters)






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






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






49. Less than symbol






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