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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following is a valid function name?
2. The values being passed through a function-call statement are called .....
3. What is returned by math.ceil(3.4)?
4. Select the advantages of functions
5. What will be the output of the following code? "'pythondef is ..... even(number):return number % 2 == 0result = is ..... even(4)print(result) "'
6. What type of variable is declared inside a function?
7. What is the output of the programx=50def func(x):x=2func(x)print("x value", x)
8. Which of the following statements is false about recursion
9. What does the 'strip()' method do to a string?
10. What is the output of the following Python code?num = 3print( float(num) )
11. What is a nested loop?
12. What is the output of the following code:'list(map(lambda x:x**2, [1, 2, 3, 4]))'?
13. What will be printed by the following code? "'pythondef add(a, b):return a + bprint(add(3, 5)) "'
14. Which of the following is NOT a benefit of using functions?
15. What is the purpose of the math module in Python?
16. What is the purpose of a return statement in a function?
17. What will be the output of the following code? def display():print('program') display()
18. Assertion. A parameter having a default value in the function header is known as a default parameter.Reason. The default values for parameters are considered only if no value is provided for that parameter in the function call statement.
19. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(obj2, 12)
20. What is the output of the following code? def add(x, y):return x + y; print(add(2, 3))
21. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(spacing=20)
22. What does the range() function in Python do?
23. What is the primary purpose of a for loop in Python?
24. What is the correct way to define a function that multiplies two numbers?
25. How do you call a function in Python?