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. square root






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






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






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






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






6. This statement causes an exception.






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






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






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






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






11. Function to write something to a file






12. modulus AND assignment operator






13. Reads just one line of a text file.






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






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






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






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






18. Adds something to a variable






19. Adds something to a variable






20. Function to write something to a file






21. divide AND assignment operator






22. single line comment






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






24. exponent AND assignment operator






25. sets the file's current position






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






27. Command to print to the screen






28. Less than symbol






29. square root






30. prints its parameter to the console






31. multiply AND assignment operator






32. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






33. Greater than or equal symbol.






34. exponentiation






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






36. Symbol to subtract things from each other






37. assignment operator






38. 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).






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






40. Argument variable






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






42. subtract AND assignment operator






43. Turns a line into a comment instead of executable code.






44. Argument variable






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






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






47. Writes stuff to the file.






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






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






50. A built-in function that converts its argument to a string.