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. Less than or equal to symbol






2. Function to open or read a file






3. inserts an item inside a list at a certain index






4. A statement that assigns a value to a variable.






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






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






7. Symbol used to create comments






8. Adds something to a variable






9. End header line.






10. exponent AND assignment operator






11. prints its parameter to the console






12. turns an object into a string






13. unction to read one line of a file






14. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






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






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






18. floor division






19. This statement exits a function. The remaining lines of the function are not executed.






20. Function to write something to a file






21. Symbol to add things together






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






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






24. exponentiation






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






26. modulo






27. square root






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






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






30. Symbol to multiply things






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






32. floor division






33. Symbol used to create comments






34. Argument variable






35. add AND assignment operator






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






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






38. multiply AND assignment operator






39. Command to print to the screen






40. adds an item to a list






41. turns an object into an integer






42. Adds something to a variable






43. divide AND assignment operator






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






45. End header line.






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






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






48. empties the file






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






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