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






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






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






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






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






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






7. divide AND assignment operator






8. prints its parameter to the console






9. Create a variable.






10. add AND assignment operator






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






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






13. subtract AND assignment operator






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






15. Function to read the contents of a file






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






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






18. Adds a new line character






19. Symbol to subtract things from each other






20. Function to open or read a file






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






22. Symbol to multiply things






23. A keyword that does nothing but fill space to indicate code which will be written later.






24. End header line.






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






26. returns the length of a string (number of characters)






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






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






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






30. The extension for Python scripts






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






32. End header line.






33. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






34. Symbol to add things together






35. square root






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






37. Greater than or equal symbol.






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






39. adds an item to a list






40. Writes stuff to the file.






41. Prevents a runtime error from stopping the program.






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






43. multiply AND assignment operator






44. assignment operator






45. modulo






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






47. A logical operator which returns a value of True if either of the conditions is true.






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






49. Adds something to a variable






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