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






2. subtract AND assignment operator






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






4. Argument variable






5. Adds a new line character






6. Function to open or read a file






7. unction to read one line of a file






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






9. Less than or equal to symbol






10. Greater than symbol






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






12. End header line.






13. A statement that breaks out of a loop.






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






15. Adds a new line character






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






17. Writes stuff to the file.






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






19. prints its parameter to the console






20. Less than or equal to symbol






21. multiply AND assignment operator






22. Reads the contents of the file you can assign the result to a variable.






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






24. divide AND assignment operator






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






26. Command to print to the screen






27. Greater than or equal symbol.






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






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






30. This statement causes an exception.






31. Function to read the contents of a file






32. Symbol to subtract things from each other






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






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






35. exponentiation






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






37. absolute value






38. Greater than symbol






39. adds an item to a list






40. turns an object into an integer






41. floor division AND assignment operator






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






43. Command to print to the screen






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






45. Function to write something to a file






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






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






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






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






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