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. Modulus operator. It's the remainder after division






2. Create a variable.






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






4. floor division AND assignment operator






5. Symbol used to create comments






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






7. Adds a new line character






8. Greater than or equal symbol.






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






10. subtract AND assignment operator






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






12. deletes an item from a list






13. modulus AND assignment operator






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






15. Greater than symbol






16. Create a variable.






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






18. Command to print to the screen






19. Adds something to a variable






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






21. absolute value






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






23. writes stuff to the file






24. square root






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






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






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






28. unction to read one line of a file






29. End header line.






30. multiply AND assignment operator






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






32. Symbol to multiply things






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






34. Function to open or read a file






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






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






37. modulo






38. Reads just one line of a text file.






39. adds an item to a list






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






41. exponent AND assignment operator






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






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






44. Function to open or read a file






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






46. divide AND assignment operator






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






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






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






50. Function to read the contents of a file