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. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.






2. unction to read one line of a file






3. modulus AND assignment operator






4. prints its parameter to the console






5. absolute value






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






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






8. Adds a new line character






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






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






11. Adds something to a variable






12. divide AND assignment operator






13. deletes an item from a list






14. turns an object into an integer






15. End header line.






16. assignment operator






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






18. add AND assignment operator






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






20. modulus AND assignment operator






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






22. Symbol to multiply things






23. Symbol to subtract things from each other






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






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






26. Turns a line into a comment instead of executable code.






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






28. Prevents a runtime error from stopping the program.






29. Reads just one line of a text file.






30. subtract AND assignment operator






31. Argument variable






32. subtract AND assignment operator






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






34. Less than symbol






35. sets the file's current position






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






37. turns an object into a string






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






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






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






41. Function to open or read a file






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






43. Greater than or equal symbol.






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






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






46. An operator that removes a value from a list.






47. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






48. Function to write something to a file






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






50. adds an item to a list