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






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






3. prints its parameter to the console






4. Symbol used to create comments






5. Argument variable






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






7. assignment operator






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






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






10. add AND assignment operator






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






12. Argument variable






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






14. Symbol to multiply things






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






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






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






18. modulus AND assignment operator






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






20. add AND assignment operator






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






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






23. Symbol to add things together






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






25. square root






26. Less than or equal to symbol






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






28. Create a variable.






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






30. Greater than or equal symbol.






31. Less than symbol






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






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






34. multiply AND assignment operator






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






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






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






38. Greater than symbol






39. modulus AND assignment operator






40. floor division






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






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






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






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






45. divide AND assignment operator






46. absolute value






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






48. absolute value






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






50. Create a variable.