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. turns an object into a string






2. floor division AND assignment operator






3. exponentiation






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






5. Symbol used to create comments






6. End header line.






7. subtract AND assignment operator






8. A logical operator which negates an expression so that it returns a value of True if the expression is false.






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






10. turns an object into an integer






11. Symbol to multiply things






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






13. modulus AND assignment operator






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






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






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






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






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






19. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.






20. Less than symbol






21. Function to read the contents of a file






22. assignment operator






23. Function to read the contents of a file






24. floor division AND assignment operator






25. floor division






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






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






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






29. Symbol to subtract things from each other






30. Create a variable.






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






32. divide AND assignment operator






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






34. modulo






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






36. Adds a new line character






37. Greater than or equal symbol.






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






39. exponent AND assignment operator






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






41. absolute value






42. Greater than or equal symbol.






43. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






44. The extension for Python scripts






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






46. deletes an item from a list






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






48. Function to open or read a file






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






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