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. A built-in function that converts its argument to a string.






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






3. modulus AND assignment operator






4. divide AND assignment operator






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






6. add AND assignment operator






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






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






9. assignment operator






10. Adds something to a variable






11. Argument variable






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






13. Argument variable






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






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






16. empties the file






17. Symbol to multiply things






18. prints its parameter to the console






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






20. Function to write something to a file






21. exponent AND assignment operator






22. Adds a new line character






23. End header line.






24. Adds a new line character






25. Function to write something to a file






26. A statement that assigns a value to a variable.






27. adds an item to a list






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






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






30. Create a variable.






31. sets the file's current position






32. Reads just one line of a text file.






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






34. floor division






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






36. unction to read one line of a file






37. Less than or equal to symbol






38. exponentiation






39. Less than symbol






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






41. A logical operator which negates an expression so that it returns a value of True if the expression is false.






42. exponentiation






43. turns an object into an integer






44. A logical operator which requires two expressions to both be true.






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






46. Reads the contents of the file you can assign the result to a variable.






47. Symbol to add things together






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. divide AND assignment operator






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