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. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101






2. adds an item to a list






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






4. unction to read one line of a file






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






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






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






8. modulus AND assignment operator






9. Reads just one line of a text file.






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






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






12. Adds something to a variable






13. Create a variable.






14. turns an object into an integer






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






16. exponentiation






17. Adds something to a variable






18. Function to read the contents of a file






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






20. Writes stuff to the file.






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






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






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






24. assignment operator






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






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






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






28. Function to write something to a file






29. Greater than or equal symbol.






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






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






32. square root






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






34. modulo






35. modulo






36. absolute value






37. deletes an item from a list






38. Prevents a runtime error from stopping the program.






39. A statement that ends the current iteration of a loop but continues looping.






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






41. multiply AND assignment operator






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






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






44. Less than or equal to symbol






45. Adds a new line character






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






47. writes stuff to the file






48. Symbol used to create comments






49. turns an object into a string






50. Argument variable