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 subtract things from each other






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






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






4. Symbol to multiply things






5. exponentiation






6. absolute value






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






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






9. This keyword in the body of a conditional allows chained conditionals.






10. Function to read the contents of a file






11. divide AND assignment operator






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






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






14. Argument variable






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






16. Function to write something to a file






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






18. Less than or equal to symbol






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






20. Less than symbol






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






22. add AND assignment operator






23. Command to print to the screen






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






25. Command to print to the screen






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






27. assignment operator






28. deletes an item from a list






29. subtract AND assignment operator






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






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






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






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






34. prints its parameter to the console






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






36. Create a variable.






37. deletes an item from a list






38. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.






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






40. Symbol used to create comments






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






42. End header line.






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






44. Adds something to a variable






45. Function to open or read a file






46. modulo






47. Adds a new line character






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






49. writes stuff to the file






50. turns an object into a string