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 string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






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






4. modulo






5. turns an object into a string






6. adds an item to a list






7. floor division






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






9. divide AND assignment operator






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






11. unction to read one line of a file






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






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






14. Command to print to the screen






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






16. deletes an item from a list






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






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






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






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






21. modulo






22. Create a variable.






23. Symbol to add things together






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






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






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






27. Symbol to subtract things from each other






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






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






30. Adds something to a variable






31. Argument variable






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






33. empties the file






34. modulus AND assignment operator






35. sets the file's current position






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






37. Function to write something to a file






38. assignment operator






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






40. Reads just one line of a text file.






41. Function to open or read a file






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






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






44. Less than or equal to symbol






45. turns an object into a string






46. Symbol used to create comments






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






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






49. Less than or equal to symbol






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