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. unction to read one line of a file






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






3. turns an object into an integer






4. Less than symbol






5. modulus AND assignment operator






6. Greater than or equal symbol.






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






8. modulo






9. divide AND assignment operator






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






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






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






13. Symbol to multiply things






14. divide AND assignment operator






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






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






17. Symbol to add things together






18. square root






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






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






21. Turns a line into a comment instead of executable code.






22. deletes an item from a list






23. single line comment






24. Adds a new line character






25. Function to write something to a file






26. Reads just one line of a text file.






27. Less than or equal to symbol






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






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






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






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






32. Greater than symbol






33. deletes an item from a list






34. Function to read the contents of a file






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






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






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






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






39. subtract AND assignment operator






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






41. Symbol to multiply things






42. sets the file's current position






43. Greater than symbol






44. A keyword that does nothing but fill space to indicate code which will be written later.






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






46. modulo






47. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.






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






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






50. This statement causes an exception.