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. A statement that assigns a value to a variable.






2. square root






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






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






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






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






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






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






9. floor division AND assignment operator






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






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






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






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






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






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






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






17. Symbol used to create comments






18. Symbol to subtract things from each other






19. empties the file






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






21. divide AND assignment operator






22. add AND assignment operator






23. Function to write something to a file






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






25. multiply AND assignment operator






26. Function to close a file - it will not be able to be used again unless the file is opened.






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






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






29. subtract AND assignment operator






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






31. Greater than or equal symbol.






32. Function to write something to a file






33. Adds something to a variable






34. An operator that removes a value from a list.






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






36. Symbol used to create comments






37. adds an item to a list






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






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






40. Adds something to a variable






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






42. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






43. Prevents a runtime error from stopping the program.






44. exponent AND assignment operator






45. prints its parameter to the console






46. single line comment






47. absolute value






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






49. The extension for Python scripts






50. Adds a new line character