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. Function to write something to a file






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






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






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






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






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






7. Argument variable






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






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






10. prints its parameter to the console






11. Reads just one line of a text file.






12. Symbol to add things together






13. Symbol to add things together






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






15. Function to open or read a file






16. adds an item to a list






17. Symbol to subtract things from each other






18. Create a variable.






19. turns an object into a string






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






21. Adds a new line character






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






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






24. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






25. Less than symbol






26. Prevents a runtime error from stopping the program.






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






28. prints its parameter to the console






29. multiply AND assignment operator






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






31. The extension for Python scripts






32. The extension for Python scripts






33. assignment operator






34. divide AND assignment operator






35. Less than symbol






36. Symbol to multiply things






37. floor division AND assignment operator






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






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






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






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






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






43. assignment operator






44. Argument variable






45. Create a variable.






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






47. add AND assignment operator






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






49. End header line.






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