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 divide by the number to the right of the symbol






2. prints its parameter to the console






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






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






5. modulus AND assignment operator






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






7. Less than symbol






8. turns an object into a string






9. absolute value






10. Symbol to multiply things






11. exponentiation






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






13. subtract AND assignment operator






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






15. exponent AND assignment operator






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






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






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






19. add AND assignment operator






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






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






22. Symbol to add things together






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






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






25. square root






26. Adds something to a variable






27. Command to print to the screen






28. Prevents a runtime error from stopping the program.






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






30. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






31. Greater than symbol






32. modulus AND assignment operator






33. floor division AND assignment operator






34. prints its parameter to the console






35. turns an object into an integer






36. square root






37. This statement causes an exception.






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






39. adds an item to a list






40. The extension for Python scripts






41. Greater than or equal symbol.






42. Symbol used to create comments






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






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






45. Function to read the contents of a file






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






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






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






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






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