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






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






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






4. Greater than symbol






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






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






7. unction to read one line of a file






8. Function to write something to a file






9. floor division






10. Argument variable






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






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






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






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






15. Function to read the contents of a file






16. subtract AND assignment operator






17. exponentiation






18. A built-in function that converts integers and strings to floating-point numbers.






19. turns an object into a string






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






21. subtract AND assignment operator






22. Command to print to the screen






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






24. Function to read the contents of a file






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






26. The extension for Python scripts






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






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






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






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






31. Adds a new line character






32. Reads just one line of a text file.






33. modulo






34. Greater than symbol






35. Less than or equal to symbol






36. Symbol to multiply things






37. Symbol to add things together






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. A logical operator which returns a value of True if either of the conditions is true.






40. This statement exits a function. The remaining lines of the function are not executed.






41. unction to read one line of a file






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






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






44. The keyword beginning a header that will create a new function.






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






46. Create a variable.






47. multiply AND assignment operator






48. Adds a new line character






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






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