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. rounds a number to the number of decimal points you choose






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






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






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






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






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






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






8. Adds a new line character






9. Symbol used to create comments






10. add AND assignment operator






11. adds an item to a list






12. exponentiation






13. Prevents a runtime error from stopping the program.






14. Less than symbol






15. square root






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






17. divide AND assignment operator






18. Less than or equal to symbol






19. Greater than or equal symbol.






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






21. Greater than or equal symbol.






22. prints its parameter to the console






23. subtract AND assignment operator






24. Symbol to subtract things from each other






25. floor division AND assignment operator






26. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.






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






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






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






30. assignment operator






31. Function to read the contents of a file






32. This statement causes an exception.






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






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






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






36. A statement that breaks out of a loop.






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






38. adds an item to a list






39. Adds a new line character






40. turns an object into a string






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






42. Argument variable






43. square root






44. Create a variable.






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






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






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






48. exponent AND assignment operator






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






50. exponent AND assignment operator