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 subtract things from each other






2. Command to print to the screen






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






4. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101






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






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






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






8. assignment operator






9. deletes an item from a list






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






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






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






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






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






15. The extension for Python scripts






16. modulo






17. multiply AND assignment operator






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






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






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






21. Function to open or read a file






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






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






24. prints its parameter to the console






25. turns an object into an integer






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






27. Greater than symbol






28. Symbol to add things together






29. adds an item to a list






30. Writes stuff to the file.






31. Less than or equal to symbol






32. Greater than or equal symbol.






33. Symbol used to create comments






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






35. Adds something to a variable






36. subtract AND assignment operator






37. A statement that breaks out of a loop.






38. rounds a number to the number of decimal points you choose






39. Reads just one line of a text file.






40. Symbol to multiply things






41. Prevents a runtime error from stopping the program.






42. inserts an item inside a list at a certain index






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






44. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111






45. inserts an item inside a list at a certain index






46. The extension for Python scripts






47. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






48. turns an object into a string






49. Create a variable.






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