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. reads just one line of a text file & keeps track of where in the file you're at






2. Prevents a runtime error from stopping the program.






3. prints its parameter to the console






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






5. Function to read the contents of a file






6. Symbol to subtract things from each other






7. exponentiation






8. square root






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






10. absolute value






11. modulus AND assignment operator






12. subtract AND assignment operator






13. sets the file's current position






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






15. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.






16. End header line.






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






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






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






20. floor division






21. The extension for Python scripts






22. divide AND assignment operator






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






24. turns an object into an integer






25. Adds a new line character






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






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






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






29. single line comment






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






31. add AND assignment operator






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






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






34. exponent AND assignment operator






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






36. Create a variable.






37. adds an item to a list






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






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






40. deletes an item from a list






41. add AND assignment operator






42. floor division AND assignment operator






43. unction to read one line of a file






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






45. deletes an item from a list






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






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






48. Adds a new line character






49. Greater than symbol






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