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. asks the user for a response and returns that response






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






3. modulo






4. Adds something to a variable






5. Command to print to the screen






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






7. Function to open or read a file






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






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






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






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






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






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






14. Greater than symbol






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






16. Argument variable






17. Less than symbol






18. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






19. modulus AND assignment operator






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






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






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






23. absolute value






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






25. Less than or equal to symbol






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






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






28. End header line.






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






30. Function to write something to a file






31. Function to read the contents of a file






32. Symbol used to create comments






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






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






35. add AND assignment operator






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






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






38. adds an item to a list






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






40. assignment operator






41. turns an object into a string






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






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






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






45. exponent AND assignment operator






46. Greater than symbol






47. deletes an item from a list






48. turns an object into an integer






49. subtract AND assignment operator






50. Symbol used to create comments