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. unction to read one line of a file






2. deletes an item from a list






3. divide AND assignment operator






4. absolute value






5. turns an object into an integer






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






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






8. empties the file






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






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






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






12. Symbol to divide by the number to the right of the symbol






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






14. Argument variable






15. Prevents a runtime error from stopping the program.






16. assignment operator






17. deletes an item from a list






18. Function to open or read a file






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






20. End header line.






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






22. prints its parameter to the console






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






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






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






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






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






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






29. modulo






30. Symbol to multiply things






31. subtract AND assignment operator






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






33. add AND assignment operator






34. Reads just one line of a text file.






35. Adds something to a variable






36. adds an item to a list






37. Argument variable






38. Symbol to add things together






39. multiply AND assignment operator






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






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






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






43. writes stuff to the file






44. The extension for Python scripts






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






46. Symbol to subtract things from each other






47. Adds a new line character






48. divide AND assignment operator






49. Symbol used to create comments






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