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. Symbol to add things together






2. modulus AND assignment operator






3. Create a variable.






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






5. Adds something to a variable






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






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






8. Symbol used to create comments






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






10. modulo






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






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






13. Symbol to add things together






14. This keyword in the body of a conditional allows chained conditionals.






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






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






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






18. absolute value






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






20. End header line.






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






22. deletes an item from a list






23. Command to print to the screen






24. floor division






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






26. assignment operator






27. square root






28. unction to read one line of a file






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






30. subtract AND assignment operator






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






32. writes stuff to the file






33. turns an object into an integer






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






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






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






37. floor division AND assignment operator






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






39. End header line.






40. assignment operator






41. exponentiation






42. adds an item to a list






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






44. The extension for Python scripts






45. turns an object into a string






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






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






48. Function to write something to a file






49. Function to open or read a file






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