ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Python MCQ Practice Questions SET 12
2
3
Sr. No.QuestionOption 1Option 2Option 3Option 4Correct Option
4
111How are arguments passed to a function in Python?By specifying them in the function call separated by commasBy using square bracketsBy assigning them to a variableBy enclosing them in curly bracesA
5
112What is the purpose of the return statement in a function?To specify the arguments passed to the functionTo define the functionTo execute the functionTo return a value from the functionD
6
113Which type of function allows for an arbitrary number of arguments to be passed?Function with default argumentsFunction with keyword argumentsFunction with arbitrary argumentsFunction with no argumentsC
7
114What happens if a function is called with fewer arguments than specified in the function definition?It raises an errorIt uses default values for the missing argumentsIt assigns None to the missing argumentsIt ignores the missing argumentsA
8
115What is the primary advantage of using keyword arguments in a function call?They allow for passing arguments in any orderThey ensure that all arguments are passedThey allow for passing an arbitrary number of argumentsThey provide default values for argumentsA
9
116How do you define a default argument in a Python function?By assigning a value to the argument in the function definitionBy using square brackets around the argumentBy placing an asterisk (*) before the argumentBy specifying the argument in curly bracesA
10
117What is recursion?A process where a function calls itself to perform a taskA process where a function calls another functionA process where a function calls a built-in functionA process where a function is called by another functionA
11
118Which keyword is used to define a recursive function in Python?defrecursivefunctionrecurseA
12
119What is the base case in a recursive function?The case where the function calls itself indefinitelyThe case where the function calls another functionThe case where the function does not call itselfThe case where the function calls itself until a condition is metC
13
120In a recursive function, what is the significance of the base case?It determines when the function should stop calling itselfIt determines the maximum number of recursive callsIt defines the starting point of the functionIt specifies the arguments passed to the functionA
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100