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






2. writes stuff to the file






3. Adds something to a variable






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






5. Create a variable.






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






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






8. add AND assignment operator






9. Less than symbol






10. exponent AND assignment operator






11. Symbol to add things together






12. turns an object into an integer






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






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






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






16. Command to print to the screen






17. multiply AND assignment operator






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






19. End header line.






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






21. floor division






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






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






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






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






26. The extension for Python scripts






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






28. unction to read one line of a file






29. deletes an item from a list






30. modulo






31. unction to read one line of a file






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






33. Function to open or read a file






34. turns an object into a string






35. Symbol to multiply things






36. turns an object into a string






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






38. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






39. divide AND assignment operator






40. sets the file's current position






41. empties the file






42. Less than or equal to symbol






43. assignment operator






44. Symbol to subtract things from each other






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






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






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






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






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






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