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. Function to open or read a file






3. exponent AND assignment operator






4. Function to read the contents of a file






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






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






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






8. A statement that breaks out of a loop.






9. prints its parameter to the console






10. Function to write something to a file






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






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






13. Less than or equal to symbol






14. This statement causes an exception.






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






16. absolute value






17. Greater than or equal symbol.






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






19. Command to print to the screen






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






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






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






23. Less than or equal to symbol






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






25. A logical operator which negates an expression so that it returns a value of True if the expression is false.






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






27. multiply AND assignment operator






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






29. Function to read the contents of a file






30. Greater than symbol






31. Greater than symbol






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






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






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






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






36. turns an object into a string






37. Command to print to the screen






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






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






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






41. Create a variable.






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






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






44. Adds something to a variable






45. exponentiation






46. Less than symbol






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






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






49. deletes an item from a list






50. assignment operator