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






2. Greater than or equal symbol.






3. turns an object into a string






4. assignment operator






5. modulo






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






7. exponentiation






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






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






10. Less than symbol






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






12. End header line.






13. Symbol to add things together






14. assignment operator






15. floor division AND assignment operator






16. Greater than symbol






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






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






19. modulus AND assignment operator






20. turns an object into a string






21. adds an item to a list






22. Function to read the contents of a file






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






24. unction to read one line of a file






25. Adds something to a variable






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






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






28. floor division






29. Create a variable.






30. Function to open or read a file






31. Greater than symbol






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






33. A statement that breaks out of a loop.






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






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






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






37. Reads just one line of a text file.






38. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






39. Argument variable






40. exponentiation






41. Symbol to add things together






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






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






44. Writes stuff to the file.






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






46. sets the file's current position






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






48. floor division AND assignment operator






49. writes stuff to the file






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