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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What does the range() function return in Python 3?
2. Which of the following is not a part of the python function?
3. Which of the following is true about the scope of variables in Python?
4. What does a negative step size in Python indicate?
5. Functions make code re-usable
6. What is the difference between an argument and a parameter?
7. What are keyword arguments in function calls?
8. What will be the output of the following code? def func(s):return len(s); print(func('Hello'))
9. What will be the output of the following code? "'pythondef power(base, exponent):return base ** exponentresult = power(2, 3)print(result) "'
10. How can you pass a list as an argument to a function in Python?
11. What is the default return value of a function that does not have a 'return' statement?
12. What does the function header contain?
13. What is the purpose of a user-defined function?
14. How do you call a function named 'calculate ..... sum' in Python?
15. What is the output of the following code? "'pythondef sum ..... and ..... diff(a, b):return a + b, a-bresult = sum ..... and ..... diff(7, 3)print(result) "'
16. What is the output of the following code:'print((lambda x:x / 2)(8))'?
17. What does the return statement do in a function?
18. By default, if you return multiple values separated by commas, then it is returned as
19. Which of the following condition is true?
20. How do you call a lambda function in Python?
21. Aman wants to write a function in Python but doesn't know how to start it. Select the keyword used to start a function out of the following.
22. What does the random function return?
23. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(obj11, object=obj12)
24. Identify the function that returns the number of items in a list.
25. Pick one from the following statements to correctly complete the function body to get the output 5 in the given code snippet:def f(number):#missing function bodyprint(f(5))