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. A logical operator which compares two operands and produces True if they are equal and False otherwise






2. Command to print to the screen






3. A logical operator which requires two expressions to both be true.






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






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






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






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






8. The extension for Python scripts






9. Function to write something to a file






10. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.






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






12. turns an object into an integer






13. deletes an item from a list






14. assignment operator






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






16. exponentiation






17. modulus AND assignment operator






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






19. Function to read the contents of a file






20. Greater than symbol






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






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






23. Writes stuff to the file.






24. Greater than or equal symbol.






25. absolute value






26. Reads just one line of a text file.






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






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






29. square root






30. writes stuff to the file






31. Function to open or read a file






32. Argument variable






33. adds an item to a list






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






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






36. Prevents a runtime error from stopping the program.






37. modulo






38. modulus AND assignment operator






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






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






41. Symbol to subtract things from each other






42. Less than symbol






43. Greater than or equal symbol.






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






45. A statement that ends the current iteration of a loop but continues looping.






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






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






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






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






50. floor division AND assignment operator