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. assignment operator






2. exponentiation






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






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






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






6. A statement that breaks out of a loop.






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






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






9. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






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






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






12. The extension for Python scripts






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






14. Function to read the contents of a file






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






16. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






17. floor division AND assignment operator






18. exponent AND assignment operator






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






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






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






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






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






24. Less than symbol






25. modulo






26. Function to open or read a file






27. turns an object into a string






28. Symbol to multiply things






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. Function to open or read a file






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






32. Create a variable.






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






34. multiply AND assignment operator






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






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






37. absolute value






38. Greater than or equal symbol.






39. Greater than symbol






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






41. Reads just one line of a text file.






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






43. Empties the file - watch out if you care about the file.






44. sets the file's current position






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






46. Create a variable.






47. adds an item to a list






48. Function to write something to a file






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






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