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






2. floor division AND assignment operator






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






4. Symbol used to create comments






5. Symbol used to create comments






6. Function to open or read a file






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






8. adds an item to a list






9. square root






10. sets the file's current position






11. prints its parameter to the console






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






13. A statement that breaks out of a loop.






14. End header line.






15. Greater than or equal symbol.






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






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






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






19. modulus AND assignment operator






20. single line comment






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






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






23. A statement that ends the current iteration of a loop but continues looping.






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






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






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






27. prints its parameter to the console






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






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






30. Adds a new line character






31. writes stuff to the file






32. End header line.






33. divide AND assignment operator






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






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






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






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






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






39. Function to open or read a file






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






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






42. A built-in function that converts integers and strings to floating-point numbers.






43. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






44. Greater than symbol






45. multiply AND assignment operator






46. multiply AND assignment operator






47. Command to print to the screen






48. Symbol to multiply things






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






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