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






2. writes stuff to the file






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






4. Symbol to add things together






5. A statement that breaks out of a loop.






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






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






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






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






10. floor division






11. unction to read one line of a file






12. Symbol used to create comments






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






14. subtract AND assignment operator






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






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






17. Less than or equal to symbol






18. multiply AND assignment operator






19. Greater than or equal symbol.






20. exponentiation






21. The extension for Python scripts






22. Less than or equal to symbol






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






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






25. Reads the contents of the file you can assign the result to a variable.






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






27. assignment operator






28. modulus AND assignment operator






29. divide AND assignment operator






30. Writes stuff to the file.






31. Adds a new line character






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. Command to print to the screen






34. Adds something to a variable






35. exponentiation






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






37. absolute value






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






39. add AND assignment operator






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






41. Argument variable






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






43. End header line.






44. adds an item to a list






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






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






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






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






49. Symbol to subtract things from each other






50. adds an item to a list