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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Can a function in Python return multiple values?
2. What is the output of fruits.clear() if fruits = ['apple', 'banana', 'cherry']?
3. Def =
4. What is a local variable?
5. What is the purpose of using functions in programming?
6. Which keyword is used to send a value back from a function in Python?
7. What is the purpose of modularization in programming?
8. User can change the functionality of a built in functions.
9. What is the output of the following code? "'pythoncount = 0def increment():global count count += 1increment()print(count) "'
10. How do you use the dir() function in Python?
11. Which keyword marks the beginning of the function block
12. What is the scope of variables declared at the top level of a module or directly in the interpreter?
13. Can a function call itself in Python? If yes, what is it called?
14. Which of the following statements is true about functions in Python?
15. Fill in the line of code for calculating the factorial of a number.def fact(num):if num == 0:return 1 else:return .....
16. When large programs are broken down into smaller units known as .....
17. How do you pass a lambda function as an argument to another function in Python?
18. Def fun1(x, y):x = x + y y = x-y x = x-y print('a =', x) print('b =', y) a = 5 b = 3 fun1(a, b)
19. Which type of loop in Python is used when a set of statements needs to be executed repeatedly based on a condition?
20. What is the syntax for a function with required arguments?
21. How do you access the first character of a string?
22. Python passes arguments to function by
23. What function can be used to split a string into a list?
24. What is the purpose of an IPO chart?
25. When defining a function, the definition must occur before it is called.