Short Quiz 7 – Functions Welcome to your Short Quiz 7 - Functions 1. What is the purpose of the return statement in a Python function? To terminate the function To specify the input parameters To indicate the start of the function To specify the output value 2. What is the purpose of the def keyword in Python? Define a class Define a function Declare a variable Define a constant 3. Which of the following is the correct way to define a function in Python? function my_function(): define my_function(): def my_function(): function my_function {} 4. In Python, how are arguments passed to a function by default? By reference By value By pointer By name 5. What does the *args syntax in a function definition indicate? It specifies default arguments It allows passing a variable number of positional arguments It denotes keyword arguments It represents a lambda function 6. How do you return multiple values from a function in Python? Using the return statement followed by a tuple Using the yield statement Using the return statement followed by a list Python does not support returning multiple values 7. In Python, what is the default return value of a function if no return statement is specified? None 0 An empty string ('') Raises an error 8. What does the **kwargs syntax in a function definition indicate? It is used for declaring default arguments. It is used for variable-length arguments. It is used for keyword arguments. It is used for class inheritance. 9. What is the purpose of the global keyword in a function? To declare a global variable To import a global module To define a global function Python does not have a global keyword 10. What will be the output of this code? def greet(name="Guest"): return "Hello, " + name + "!"print(greet()) "Hello, Guest!" "Hello, World!" "Hello,!" Error 11. What will be the output of this code? def power(base, exponent=2): return base ** exponentresult = power(3)print(result) 3 6 9 27 12. What will be the output of this code? def concatenate_strings(*args): return " ".join(args)result = concatenate_strings("Hello", "World", "!")print(result) "Hello World !" "HelloWorld!" "Hello,World,!" Error 13. What will be the output of this code? def is_even(num): return num % 2 == 0numbers = [1, 2, 3, 4, 5]filtered_numbers = list(filter(is_even, numbers))print(filtered_numbers) [1, 3, 5] [2, 4] [1, 2, 3, 4, 5] Error 14. What will be the output of this code? def square(num): return num ** 2numbers = [1, 2, 3, 4]squared_numbers = list(map(square, numbers))print(squared_numbers) [1, 2, 3, 4] [1, 4, 9, 16] [2, 4, 6, 8] Error 1 out of 14