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. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






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






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






4. Greater than or equal symbol.






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






6. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






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






8. Function to write something to a file






9. floor division AND assignment operator






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






11. modulo






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






13. Symbol used to create comments






14. subtract AND assignment operator






15. This statement causes an exception.






16. Symbol to multiply things






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






18. turns an object into a string






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






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






21. unction to read one line of a file






22. Symbol to multiply things






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






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






25. divide AND assignment operator






26. floor division






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






28. Symbol to add things together






29. deletes an item from a list






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






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






32. The extension for Python scripts






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






34. absolute value






35. assignment operator






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






37. single line comment






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






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






40. Less than symbol






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






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






43. Adds something to a variable






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






45. Less than or equal to symbol






46. Function to open or read a file






47. Less than symbol






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






49. Function to read the contents of a file






50. The extension for Python scripts