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. Symbol to divide by the number to the right of the symbol






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






4. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






5. Symbol to subtract things from each other






6. square root






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






8. Empties the file - watch out if you care about the file.






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






10. turns an object into an integer






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






12. Adds a new line character






13. A statement that breaks out of a loop.






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






15. assignment operator






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






17. The extension for Python scripts






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






19. modulus AND assignment operator






20. adds an item to a list






21. Greater than symbol






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






23. Less than symbol






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






25. add AND assignment operator






26. subtract AND assignment operator






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






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






29. This statement exits a function. The remaining lines of the function are not executed.






30. Create a variable.






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






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






33. sets the file's current position






34. Less than symbol






35. Less than or equal to symbol






36. modulus AND assignment operator






37. Greater than symbol






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






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






40. Command to print to the screen






41. Prevents a runtime error from stopping the program.






42. deletes an item from a list






43. prints its parameter to the console






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






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






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






47. empties the file






48. Argument variable






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






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