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

Quiz Instructions

Select an option to see the correct answer instantly.

1. The first line of a function definition is known as the .....
2. Recall what will a function return if there is no return statement.
3. Def fun1(a, b):return a+b, a=b, a*b, a/ba=fun1(10, 2)Here a will be created as
4. How can you check the type of a variable in Python?
5. Which Python function returns the length of a string or a list?
6. Assertion. A parameter having a default in function header becomes optional in function call.Reason. A function call may or may not have values for default arguments.
7. Predict the output, if the value passed for the given function is 2.def game(x):return 4**x
8. What type of argument is passed during function definition?
9. What is the purpose of the 'break' statement in Python?
10. Read the following statements and then select the answer:Statement A:Default arguments can be used to add new parameters to the existing functionsStatement B:Default arguments can be used to combine similar functions into one
11. What is the output of the following Python code?print(round(51.6))
12. What will be the output of the following code? "'pythondef max ..... value(a, b):if a > b:return a else:return bresult = max ..... value(5, 10)print(result) "'
13. What is the output of the following code? def main():print('This is python'); main()
14. What is the order of resolving scope of a name in a python program?
15. What is the output of the following code? def add(j):if(j>=4):j=j*j else:j=j*2 return j; print(add(5))
16. Which of the following is a valid use of a lambda function?
17. Which of the following is a characteristic of a parameterized function?
18. A function can be with or without returning any values.
19. What is the correct way to define a function that returns nothing?
20. Which method reverses the order of elements in a list?
21. What happens if the base condition isn't defined in recursive programs?
22. What is the output of the following code:'print((lambda x:x-2)(10))'?
23. What is the term for a function that calls itself in Python?
24. What does the 'find()' method return if the substring is not found?
25. Which of the following problems can be solved using recursion?