| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Python MCQ Practice Questions SET 12 | |||||||||||||||||||||||||
2 | ||||||||||||||||||||||||||
3 | Sr. No. | Question | Option 1 | Option 2 | Option 3 | Option 4 | Correct Option | |||||||||||||||||||
4 | 111 | How are arguments passed to a function in Python? | By specifying them in the function call separated by commas | By using square brackets | By assigning them to a variable | By enclosing them in curly braces | A | |||||||||||||||||||
5 | 112 | What is the purpose of the return statement in a function? | To specify the arguments passed to the function | To define the function | To execute the function | To return a value from the function | D | |||||||||||||||||||
6 | 113 | Which type of function allows for an arbitrary number of arguments to be passed? | Function with default arguments | Function with keyword arguments | Function with arbitrary arguments | Function with no arguments | C | |||||||||||||||||||
7 | 114 | What happens if a function is called with fewer arguments than specified in the function definition? | It raises an error | It uses default values for the missing arguments | It assigns None to the missing arguments | It ignores the missing arguments | A | |||||||||||||||||||
8 | 115 | What is the primary advantage of using keyword arguments in a function call? | They allow for passing arguments in any order | They ensure that all arguments are passed | They allow for passing an arbitrary number of arguments | They provide default values for arguments | A | |||||||||||||||||||
9 | 116 | How do you define a default argument in a Python function? | By assigning a value to the argument in the function definition | By using square brackets around the argument | By placing an asterisk (*) before the argument | By specifying the argument in curly braces | A | |||||||||||||||||||
10 | 117 | What is recursion? | A process where a function calls itself to perform a task | A process where a function calls another function | A process where a function calls a built-in function | A process where a function is called by another function | A | |||||||||||||||||||
11 | 118 | Which keyword is used to define a recursive function in Python? | def | recursive | function | recurse | A | |||||||||||||||||||
12 | 119 | What is the base case in a recursive function? | The case where the function calls itself indefinitely | The case where the function calls another function | The case where the function does not call itself | The case where the function calls itself until a condition is met | C | |||||||||||||||||||
13 | 120 | In a recursive function, what is the significance of the base case? | It determines when the function should stop calling itself | It determines the maximum number of recursive calls | It defines the starting point of the function | It specifies the arguments passed to the function | A | |||||||||||||||||||
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 | ||||||||||||||||||||||||||