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 keyword in the body of a conditional allows chained conditionals.






2. Adds something to a variable






3. empties the file






4. absolute value






5. Less than or equal to symbol






6. This keyword in the body of a conditional - gives an alternative execution.






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






8. A data type for representing numbers with fractional values.






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






10. square root






11. Argument variable






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






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






14. Symbol to add things together






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






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






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






18. Symbol to subtract things from each other






19. returns the length of a string (number of characters)






20. subtract AND assignment operator






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






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






23. End header line.






24. divide AND assignment operator






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






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






27. exponent AND assignment operator






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






29. Symbol to multiply things






30. prints its parameter to the console






31. End header line.






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






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






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






35. Greater than symbol






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






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






38. deletes an item from a list






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






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






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






42. Create a variable.






43. turns an object into a string






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






45. Function to open or read a file






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






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






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






49. Symbol used to create comments






50. Writes stuff to the file.