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






2. add AND assignment operator






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






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






5. Greater than symbol






6. Symbol to add things together






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






8. multiply AND assignment operator






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






10. modulus AND assignment operator






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






12. prints its parameter to the console






13. empties the file






14. turns an object into a string






15. Adds a new line character






16. Argument variable






17. An operator that removes a value from a list.






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






19. This statement causes an exception.






20. Prevents a runtime error from stopping the program.






21. subtract AND assignment operator






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






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






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






25. Symbol to subtract things from each other






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






27. Function to write something to a file






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






29. assignment operator






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






31. modulo






32. absolute value






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






34. The extension for Python scripts






35. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






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






37. End header line.






38. Function to open or read a file






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






40. Symbol to multiply things






41. adds an item to a list






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






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






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






45. Symbol used to create comments






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






47. deletes an item from a list






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






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






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






Can you answer 50 questions in 15 minutes?



Let me suggest you:



Major Subjects



Tests & Exams


AP
CLEP
DSST
GRE
SAT
GMAT

Most popular tests