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. Where the parameters go. A necessary punctuation after any function even if it's empty.






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






3. add AND assignment operator






4. exponent AND assignment operator






5. Less than or equal to symbol






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






7. Symbol to add things together






8. multiply AND assignment operator






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






10. empties the file






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






12. unction to read one line of a file






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






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






15. modulo






16. turns an object into an integer






17. modulus AND assignment operator






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






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






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






21. Greater than or equal symbol.






22. Less than symbol






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






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






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






26. Symbol to multiply things






27. An operator to check whether two variables refer to the same object.






28. Greater than symbol






29. exponentiation






30. turns an object into a string






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






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






33. writes stuff to the file






34. Symbol to add things together






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






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






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






38. Function to open or read a file






39. divide AND assignment operator






40. square root






41. This statement causes an exception.






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






43. square root






44. Prevents a runtime error from stopping the program.






45. adds an item to a list






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






47. add AND assignment operator






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






49. single line comment






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