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. asks the user for a response and returns that response






2. modulo






3. This statement causes an exception.






4. sets the file's current position






5. absolute value






6. add AND assignment operator






7. Symbol to add things together






8. Greater than or equal symbol.






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






10. turns an object into a string






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






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






13. floor division AND assignment operator






14. The extension for Python scripts






15. A statement that displays a value on the screen.






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






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






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






19. Writes stuff to the file.






20. exponentiation






21. A built-in function that converts integers and strings to floating-point numbers.






22. Create a variable.






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






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






25. turns an object into an integer






26. Greater than symbol






27. absolute value






28. End header line.






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






30. reads just one line of a text file & keeps track of where in the file you're at






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






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






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






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






35. Symbol to multiply things






36. adds an item to a list






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






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






39. Adds something to a variable






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






41. Symbol to add things together






42. Function to write something to a file






43. floor division AND assignment operator






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






45. Symbol used to create comments






46. modulus AND assignment operator






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






48. subtract AND assignment operator






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






50. A statement that breaks out of a loop.