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. writes stuff to the file






2. Symbol used to create comments






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






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






5. End header line.






6. multiply AND assignment operator






7. floor division






8. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






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






10. assignment operator






11. absolute value






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






13. An operator that removes a value from a list.






14. Symbol to add things together






15. Create a variable.






16. unction to read one line of a file






17. A statement that breaks out of a loop.






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






19. Less than or equal to symbol






20. square root






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






22. The extension for Python scripts






23. divide AND assignment operator






24. Less than symbol






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






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






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






28. floor division AND assignment operator






29. Symbol used to create comments






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






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






32. Prevents a runtime error from stopping the program.






33. assignment operator






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






35. Less than or equal to symbol






36. Adds something to a variable






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






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






39. Function to write something to a file






40. floor division AND assignment operator






41. divide AND assignment operator






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






43. Symbol to multiply things






44. exponentiation






45. 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).






46. Command to print to the screen






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






48. Argument variable






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






50. turns an object into a string