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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What does the 'find()' method return if the substring is not found?
2. Which of the following problems can be solved using recursion?
3. What will be the output of the following code? "'pythondef remainder(a, b):return a % bresult = remainder(10, 3)print(result) "'
4. What is the purpose of using lambda functions in Python?
5. How does a function differ from a subroutine?
6. How can you convert a string to lowercase?
7. Def aver(a, b, c=10):return (a+b+c)/3requires ..... arguments compulsorily
8. Richa is working with a program where she gave some values to the function. She doesn't know the term to relate these values. Select the correct option.
9. What does the max() function in Python do?
10. What will be the output of the following code? "'pythondef divide(a, b):return a / bresult = divide(8, 2)print(result) "'
11. What is the syntax for a function with variable-length arguments?
12. Function randint() is available under which module of python?
13. Which of the following statements is true about calling functions in Python?
14. Which of the following is a correct way to document a function in Python?
15. In which part of memory does the system stores the parameter and local variables of function call
16. A function definition has ..... number of parts
17. Function header in Python contains .....
18. Assertion (A):A function is a block of organized and reusable code that is used to perform a single, related action. Reason (R):Function provides better modularity by your application and a high degree of code reusability.
19. Which of the given argument types can be skipped from a function call?
20. Which of the following keywords marks the begining of the function block?
21. What is string interpolation?
22. What type of arguments in a function call require the number of formal parameters to match the number of actual parameters?
23. Every function returns a value; if a function does not explicitly return a value, then it will return .....
24. In the range(start, stop, step) function, what does the 'stop' parameter indicate?
25. A(n) ..... is a special variable that receives a piece of data when a function is called.
26. Calling a function and defining a function mean the same thing.
27. What is the syntax of a lambda function in Python?
28. What is the purpose of the 'join()' method in strings?
29. How can you modify a global variable inside a function?
30. What will the following code output:for i in range(5, 10):print(i)?
31. What does the special value None indicate when returned from a function?
32. Def mul ..... fun(a=10, b, c=1):return a+b+cis
33. What is the purpose of the input function in the sums() function?
34. What is the output of the following piece of code?def test(i, j):if(i==0):return j else:return test(i-1, i+j) print(test(4, 7))
35. What is a lambda function in Python?
36. What is the purpose of the 'continue' statement in Python?
37. What is the correct way to define a function that takes no parameters?
38. What is the default step size in Python if it is not provided?
39. What will be the output of the following Python expression? round(4.576)
40. The function randint( ) returns random integers between low and high numbers?
41. How do you format a string using f-strings?
42. The variable declared outside a function is called a global variable.
43. What is the output of the following code? def draw ..... circle():circle(50); draw ..... circle()
44. What is the difference between print() and return in a function?
45. In which part of memory does the system store the parameters and local variables of a function call?
46. What are the benefits of using functions?
47. What will happen if you call a function with fewer arguments than it requires and no default values are set?
48. Which type of function definition allows specifying default values in the function header?
49. What is the lifetime of a variable defined inside a function?
50. Which of the following is the correct way to handle errors in a Python function?
51. Parameters in a function are like:
52. ..... is the built-in function to know the type of a variable or function.
53. What is the syntax to define a function in Python?
54. These are predefined functions that are always available for use. For using them we don't need to import any module.
55. Which of the following is a valid lambda function that returns the square of a number?
56. What function is used to find the length of a string?
57. What does the randint function do?
58. Which of the following is a keyword used to define a function in Python?
59. How do you use a lambda function with the filter() function in Python?
60. Which of the following is NOT a reason to use functions?