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 breaks out of a loop.






2. floor division AND assignment operator






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






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






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






6. Adds a new line character






7. subtract AND assignment operator






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






9. exponentiation






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






11. Function to write something to a file






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






13. turns an object into an integer






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






15. adds an item to a list






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






17. exponent AND assignment operator






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






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






20. Writes stuff to the file.






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






22. Create a variable.






23. Symbol used to create comments






24. single line comment






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






26. modulo






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






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






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






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






31. square root






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






33. unction to read one line of a file






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






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






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






37. deletes an item from a list






38. Less than or equal to symbol






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






40. Greater than symbol






41. modulus AND assignment operator






42. Symbol to add things together






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






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






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






46. add AND assignment operator






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






48. floor division






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






50. turns an object into a string