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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following is a correct way to use a lambda function to add 10 to each element in a list?
2. What is the output of the following code:'print((lambda x, y, z:x * y * z)(2, 3, 4))'?
3. What is the output of the following code? "'pythondef change():x = 5 return xx = 10print(change())print(x) "'
4. What is the difference between '==' and 'is' when comparing strings?
5. What is the correct syntax to define a function in Python?
6. ..... is the blank space in the beginning of a statement within a block.
7. Which of the following is NOT a valid lambda function?
8. What will be the output of the following code? "'pythondef concat(str1, str2):return str1 + str2result = concat("Hello, ", "World!")print(result) "'
9. What is the correct way to import a module in Python?
10. Explain the use of lambda functions in Python.
11. What will be printed by the following code? "'pythondef foo():a = 7 return aa = 3print(foo())print(a) "'
12. What will be the output of the following code? "'pythondef increment(x):x += 1 return xvalue = 5result = increment(value)print(result) "'
13. Which of the following is NOT a characteristic of a lambda function?
14. Assertion (A):There are various built in functions/methods to manipulate the dictionaries. Reason (R):Built in functions does not work on dictionaries.
15. The ..... of a variable is the area of the program where it may be referred.
16. What term is used to describe data passed into a function?
17. Values can be passed to the function using variables.
18. What is the general format for defining a function?
19. What will be the output of the following code? "'pythondef double(x):return x * 2result = double(7)print(result) "'
20. What are the reasons for using functions in programs,
21. A variable created or defined within a function body is
22. In Python, how do you call a subroutine named calculate ..... average from the main program?
23. What is the output of the following code? def main():i=4; a=add(4); print(a); main()
24. What is the correct way to define a function with a default parameter value?
25. What is the output of the function call print(add ..... five(square(4)))?