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. inserts an item inside a list at a certain index






2. Greater than or equal symbol.






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






4. multiply AND assignment operator






5. prints its parameter to the console






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






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






8. Less than symbol






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






10. A statement that breaks out of a loop.






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






12. End header line.






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






14. Symbol to subtract things from each other






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






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






17. divide AND assignment operator






18. multiply AND assignment operator






19. Symbol used to create comments






20. unction to read one line of a file






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






22. square root






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






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






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






26. adds an item to a list






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






28. add AND assignment operator






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






30. floor division AND assignment operator






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






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






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






34. turns an object into a string






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






36. floor division AND assignment operator






37. exponentiation






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. writes stuff to the file






40. adds an item to a list






41. modulus AND assignment operator






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






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






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






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






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






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






48. turns an object into a string






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






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