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 close a file - it will not be able to be used again unless the file is opened.






2. The extension for Python scripts






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






4. Greater than or equal symbol.






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






6. adds an item to a list






7. Adds a new line character






8. floor division






9. absolute value






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






11. subtract AND assignment operator






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






13. Symbol used to create comments






14. exponent AND assignment operator






15. Command to print to the screen






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






17. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






18. unction to read one line of a file






19. A logical operator which returns a value of True if either of the conditions is true.






20. writes stuff to the file






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






22. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






23. Less than or equal to symbol






24. The extension for Python scripts






25. exponent AND assignment operator






26. Function to read the contents of a file






27. This statement exits a function. The remaining lines of the function are not executed.






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






29. Adds a new line character






30. Symbol to add things together






31. Adds something to a variable






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






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






34. unction to read one line of a file






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






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






37. Symbol to multiply things






38. This statement causes an exception.






39. deletes an item from a list






40. turns an object into a string






41. Reads just one line of a text file.






42. Argument variable






43. Create a variable.






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






45. Function to read the contents of a file






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






47. A statement that breaks out of a loop.






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






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






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