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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What method would you use to replace a substring in a string?
2. In ..... arguments we can skip the default argument, but all the arguments should match the parameters in the function definitions.
3. Which statement about function parameters is TRUE?
4. What will be the output of the following code? "'pythondef subtract(a, b):return a-bresult = subtract(10, 4)print(result) "'
5. Select which of the following is NOT TRUE for Python function:
6. What is the correct syntax to call a function named 'calculate ..... Area'?
7. Do you call or define a function first?
8. In Python, if no value is provided in the function call, the argument takes (a) value.
9. How can you check if a substring exists within a string?
10. What are positional arguments in function calls?
11. Which of these is NOT a built-in function?
12. Which of the following functions is a built-in function in python?
13. What is the output of the following code:'print((lambda x, y:x * y)(3, 4))'?
14. Which function returns the largest of its arguments?
15. Which of the following symbols always comes after a function code block?
16. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(ob1)
17. Can a lambda function have multiple expressions in Python?
18. What does the map function in Python do?
19. What is the output of the following code? "'pythondef divide(a, b):try:return a / b except ZeroDivisionError:return "Cannot divide by zero"print(divide(10, 0)) "'
20. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(spacing=15, object=obj4)
21. What is the output of the following code? "'pythonx = 10def show():print(x)show() "'
22. What is a void function?
23. When you use multiple type argument in function then default argument take place
24. How to call this function?def sayHello( ):print ( "Hello World!" )
25. Which of the following is the correct syntax for a lambda function?