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






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






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






4. Adds a new line character






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






6. Argument variable






7. Less than symbol






8. deletes an item from a list






9. turns an object into a string






10. absolute value






11. add AND assignment operator






12. Create a variable.






13. multiply AND assignment operator






14. prints its parameter to the console






15. End header line.






16. Greater than or equal symbol.






17. Greater than or equal symbol.






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






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






20. Function to open or read a file






21. floor division






22. Adds a new line character






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






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






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






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






27. unction to read one line of a file






28. Less than or equal to symbol






29. multiply AND assignment operator






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






31. Function to write something to a file






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






33. deletes an item from a list






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






35. The extension for Python scripts






36. prints its parameter to the console






37. A logical operator which returns a value of True if either of the conditions is true.






38. Greater than symbol






39. modulus AND assignment operator






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






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






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






43. modulo






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






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






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






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






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






49. square root






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