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. Writes stuff to the file.






2. modulo






3. Symbol to multiply things






4. divide AND assignment operator






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






6. absolute value






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






8. exponentiation






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






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






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






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






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






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






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






16. Symbol to subtract things from each other






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






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






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






20. Empties the file - watch out if you care about the file.






21. turns an object into an integer






22. The extension for Python scripts






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






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






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






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






27. A data type for representing numbers with fractional values.






28. sets the file's current position






29. assignment operator






30. floor division AND assignment operator






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






32. deletes an item from a list






33. floor division






34. Adds a new line character






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






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






37. multiply AND assignment operator






38. Less than symbol






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






40. Command to print to the screen






41. unction to read one line of a file






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






43. Symbol to subtract things from each other






44. A statement that assigns a value to a variable.






45. unction to read one line of a file






46. Greater than or equal symbol.






47. add AND assignment operator






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






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






50. modulus AND assignment operator