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. inserts an item inside a list at a certain index






2. unction to read one line of a file






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






4. The keyword beginning a header that will create a new function.






5. turns an object into a string






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






7. writes stuff to the file






8. Symbol to subtract things from each other






9. unction to read one line of a file






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






11. modulo






12. subtract AND assignment operator






13. Function to read the contents of a file






14. divide AND assignment operator






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






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






17. The extension for Python scripts






18. exponentiation






19. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






20. Symbol to multiply things






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






22. Greater than or equal symbol.






23. sets the file's current position






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






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






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






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






28. modulo






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






30. Function to open or read a file






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






32. deletes an item from a list






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






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






35. End header line.






36. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






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






39. Greater than symbol






40. single line comment






41. A logical operator which compares two operands and produces True if they are equal and False otherwise






42. Create a variable.






43. The extension for Python scripts






44. Argument variable






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






46. The keyword beginning a header that will create a new function.






47. prints its parameter to the console






48. divide AND assignment operator






49. Writes stuff to the file.






50. exponentiation