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 to obvious but it re-enforces your understanding as you take the test each time.
1. An operator that removes a value from a list.






2. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






3. Greater than symbol






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






5. sets the file's current position






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






7. Symbol to subtract things from each other






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






9. Command to print to the screen






10. Writes stuff to the file.






11. absolute value






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






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






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






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






16. Prevents a runtime error from stopping the program.






17. 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).






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






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






20. floor division AND assignment operator






21. square root






22. Function to read the contents of a file






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






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






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






26. End header line.






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






28. Function to read the contents of a file






29. floor division






30. Function to open or read a file






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






32. deletes an item from a list






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






34. Greater than symbol






35. End header line.






36. The extension for Python scripts






37. writes stuff to the file






38. Function to open or read a file






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






40. divide AND assignment operator






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






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






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






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






45. Argument variable






46. unction to read one line of a file






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






48. Symbol used to create comments






49. Function to write something to a file






50. A built-in function that converts integers and strings to floating-point numbers.