Module 4: Data Collections and Functions
Quiz: Quiz 4: Data Collections and Functions
1. How do you define a function in Python?
2. How do you call a function named `calculate_sum` that takes two arguments, `a` and `b`?
3. What is the output of `len([1, 2, 3])`?
4. Can items in a tuple be changed after the tuple is created?
5. What does the `keys()` method of a dictionary return?
6. What is the purpose of a `try` block in Python error handling?
7. How do you specify the code to run when a particular type of error (e.g., `ValueError`) occurs in a `try` block?
8. In a function definition like `def greet(name):`, what is `name` called?
9. What is the `return` statement used for in a Python function?
10. True or False: Python lists and dictionaries are both mutable.