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. A statement that breaks out of a loop.






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






3. Writes stuff to the file.






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






5. Greater than or equal symbol.






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






7. deletes an item from a list






8. square root






9. Less than or equal to symbol






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






11. Symbol used to create comments






12. Greater than symbol






13. assignment operator






14. modulus AND assignment operator






15. floor division






16. Symbol to add things together






17. absolute value






18. prints its parameter to the console






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






20. Adds a new line character






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






22. Symbol to multiply things






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






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






25. turns an object into a string






26. writes stuff to the file






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






28. Function to write something to a file






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






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






31. Adds something to a variable






32. Function to read the contents of a file






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






34. unction to read one line of a file






35. End header line.






36. A logical operator which negates an expression so that it returns a value of True if the expression is false.






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






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






39. reads just one line of a text file & keeps track of where in the file you're at






40. The extension for Python scripts






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






42. adds an item to a list






43. Command to print to the screen






44. subtract AND assignment operator






45. Function to write something to a file






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






47. square root






48. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






49. Function to open or read a file






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