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. empties the file






2. Create a variable.






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






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






5. Greater than or equal symbol.






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






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






8. A statement that breaks out of a loop.






9. The extension for Python scripts






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






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






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






13. turns an object into a string






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






15. modulus AND assignment operator






16. floor division AND assignment operator






17. Symbol to subtract things from each other






18. Symbol to add things together






19. Adds a new line character






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






21. This statement causes an exception.






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






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






24. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






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






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






27. Adds a new line character






28. Function to read the contents of a file






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






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






31. Symbol to add things together






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






33. Reads just one line of a text file.






34. Function to write something to a file






35. divide AND assignment operator






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






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






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






39. deletes an item from a list






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






41. Command to print to the screen






42. writes stuff to the file






43. deletes an item from a list






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






45. turns an object into an integer






46. Adds something to a variable






47. square root






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






49. floor division






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