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. reads just one line of a text file & keeps track of where in the file you're at






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






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






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






5. Writes stuff to the file.






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






7. This keyword in the body of a conditional - gives an alternative execution.






8. prints its parameter to the console






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






10. unction to read one line of a file






11. Symbol used to create comments






12. floor division






13. unction to read one line of a file






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






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






16. single line comment






17. modulus AND assignment operator






18. adds an item to a list






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






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






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






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






23. assignment operator






24. The extension for Python scripts






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






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






27. deletes an item from a list






28. add AND assignment operator






29. Function to write something to a file






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






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






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






33. modulo






34. Command to print to the screen






35. This keyword in the body of a conditional - gives an alternative execution.






36. divide AND assignment operator






37. adds an item to a list






38. square root






39. exponent AND assignment operator






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






41. prints its parameter to the console






42. absolute value






43. Adds a new line character






44. Argument variable






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






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






47. modulus AND assignment operator






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






49. Function to write something to a file






50. turns an object into an integer