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. turns an object into a string






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






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






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






5. Argument variable






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






7. Symbol to subtract things from each other






8. exponent AND assignment operator






9. Symbol to multiply things






10. divide AND assignment operator






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






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






13. empties the file






14. exponent AND assignment operator






15. absolute value






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






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






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






19. turns an object into an integer






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






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






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






23. Function to write something to a file






24. Prevents a runtime error from stopping the program.






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






26. The extension for Python scripts






27. Create a variable.






28. assignment operator






29. multiply AND assignment operator






30. End header line.






31. A statement that assigns a value to a variable.






32. turns an object into an integer






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






34. Symbol used to create comments






35. floor division AND assignment operator






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






37. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






38. turns an object into a string






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






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






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






42. The extension for Python scripts






43. Less than or equal to symbol






44. Function to read the contents of a file






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






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






47. Symbol to add things together






48. A statement that breaks out of a loop.






49. deletes an item from a list






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