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. rounds a number to the number of decimal points you choose






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






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






4. Prints a string to the screen which will be Unicode.






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






6. turns an object into an integer






7. divide AND assignment operator






8. Less than symbol






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






10. absolute value






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






12. add AND assignment operator






13. Function to read the contents of a file






14. Adds something to a variable






15. assignment operator






16. exponentiation






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






18. End header line.






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






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






21. floor division






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






23. modulo






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






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






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






27. Symbol used to create comments






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






29. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






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






32. deletes an item from a list






33. Less than or equal to symbol






34. Function to write something to a file






35. Symbol to add things together






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






37. A statement that breaks out of a loop.






38. square root






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






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






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






42. floor division AND assignment operator






43. Create a variable.






44. Function to open or read a file






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






46. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






47. modulus AND assignment operator






48. Argument variable






49. A built-in function that converts integers and strings to floating-point numbers.






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