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. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






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






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






4. Less than or equal to symbol






5. square root






6. Prevents a runtime error from stopping the program.






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






8. A keyword that does nothing but fill space to indicate code which will be written later.






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






10. exponent AND assignment operator






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






12. Greater than symbol






13. divide AND assignment operator






14. Symbol to multiply things






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






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






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






18. assignment operator






19. divide AND assignment operator






20. The extension for Python scripts






21. Function to read the contents of a file






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






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






24. Less than symbol






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






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






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






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






29. unction to read one line of a file






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






31. Command to print to the screen






32. floor division AND assignment operator






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






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






35. Adds something to a variable






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






37. Reads just one line of a text file.






38. Less than or equal to symbol






39. A statement that breaks out of a loop.






40. floor division






41. sets the file's current position






42. Command to print to the screen






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






44. Symbol to add things together






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






46. single line comment






47. Function to open or read a file






48. This keyword in the body of a conditional allows chained conditionals.






49. add AND assignment operator






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