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. Prints a string to the screen which is a signed decimal.






2. unction to read one line of a file






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






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






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






6. Adds something to a variable






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






8. Command to print to the screen






9. floor division AND assignment operator






10. exponent AND assignment operator






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






12. Less than or equal to symbol






13. Adds a new line character






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






15. add AND assignment operator






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






17. absolute value






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






19. Argument variable






20. Greater than symbol






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






22. This statement causes an exception.






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






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






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






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






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






28. Argument variable






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






30. Prevents a runtime error from stopping the program.






31. Prints a string to the screen which is converted using repr()






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






33. A built-in function that converts its argument to a string.






34. Greater than symbol






35. adds an item to a list






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






37. Greater than or equal symbol.






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






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






40. turns an object into an integer






41. modulus AND assignment operator






42. multiply AND assignment operator






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






44. Function to open or read a file






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






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






47. Function to write something to a file






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






49. Prints a string to the screen which is converted using repr()






50. Symbol to add things together