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. Greater than symbol






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






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






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






5. floor division






6. Argument variable






7. Less than symbol






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






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






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






11. exponent AND assignment operator






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






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






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






15. exponentiation






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






17. empties the file






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






19. deletes an item from a list






20. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






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






22. Function to open or read a file






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






24. End header line.






25. Symbol to multiply things






26. returns the length of a string (number of characters)






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






28. single line comment






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






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






31. floor division AND assignment operator






32. Argument variable






33. Function to close a file - it will not be able to be used again unless the file is opened.






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






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






36. adds an item to a list






37. modulo






38. divide AND assignment operator






39. 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).






40. square root






41. The extension for Python scripts






42. Symbol to add things together






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






44. subtract AND assignment operator






45. Reads just one line of a text file.






46. Function to read the contents of a file






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






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






49. Symbol to add things together






50. exponentiation