Class 11 Computer Science Chapter 5 Functions In Python Quiz 15 (25 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. How do you reverse a string in Python?
2. What is the 'return' statement used for in a function?
3. A recursive function is
4. What will be the output of the following code? "'pythondef multiply(x, y):product = x * y return productprint(multiply(2, 5)) "'
5. Which of the following is a common use case for lambda functions?
6. What will be the output of this program?def addOne(number):number += 1 return numberone = addOne(0)two = addOne(one)print(two)
7. What will be the output of the following Python code?def cube(x):return x * x * xx = cube(3)print (x)
8. What is the purpose of the 'return' statement in a Python function?
9. What is the output of the following code? def first ..... five ..... even ..... numbers():for num in range(2, 11):if num % 2 == 0:print(num); first ..... five ..... even ..... numbers()
10. The ..... keyword is ignored by the Python interpreter and can be used as a placeholder for code that will be written later.
11. What is the purpose of the Turtle module in Python?
12. Assertion (A):Keyword arguments are related to the function calls. Reason (R):When you use keyword arguments in a function call, the caller identifies the arguments by the parameter name.
13. A group of statements that exist within a program for the purpose of performing a specific task is a(n) .....
14. Which of the following is the correct way to call a function named 'hello' with one argument, '"World"'?
15. What are the advantages of using functions in Python?
16. How can you use a lambda function to filter a list of numbers to only include even numbers?
17. Def fun():print('Hello User')is an example of
18. Which type of data type requires the 'global' keyword to modify a global variable inside a function?
19. What Is The Output Of The Following Code Snippet? def func(message, num = 1):print(message * num) func('Welcome')func('Viewers', 3)
20. What is a situation where you would want to use a function to simplify(make easier to read) your code?
21. Which statement about local variables is TRUE?
22. Which of the following statements is true about lambda functions?
23. The values received in a function definition/header statement are called .....
24. Functions help us to break the program into smaller chunks
25. What is the purpose of the pass keyword?