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. Greater than or equal symbol.






2. Create a variable.






3. floor division AND assignment operator






4. Less than or equal to symbol






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






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






7. modulo






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






9. divide AND assignment operator






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






11. Less than or equal to symbol






12. Adds a new line character






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






14. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






16. Command to print to the screen






17. assignment operator






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






19. Symbol to add things together






20. deletes an item from a list






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






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






23. Symbol to add things together






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






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






26. prints its parameter to the console






27. Function to read the contents of a file






28. Reads just one line of a text file.






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






30. floor division






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






32. Less than symbol






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






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






35. exponentiation






36. A statement that breaks out of a loop.






37. The extension for Python scripts






38. modulus AND assignment operator






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






40. unction to read one line of a file






41. A statement that displays a value on the screen.






42. This keyword begins a header for a body that repeats until the condition is no longer true.






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






44. A data type for representing numbers with fractional values.






45. multiply AND assignment operator






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






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






48. square root






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






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