| 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 5 | |||||||||||||||||||||||||
2 | ||||||||||||||||||||||||||
3 | Sr. No. | Question | Option 1 | Option 2 | Option 3 | Option 4 | Correct Option | |||||||||||||||||||
4 | 41 | dict1={} what is the meaning of this | will create empty dictionary | will return empty dictionary | syntax error | none of above | A | |||||||||||||||||||
5 | 42 | Which module can be used to create constant variables in Python? | constant module | constants module | const module | Consts module | A | |||||||||||||||||||
6 | 43 | Which function is used to convert a string to uppercase in Python? | str.upper() | str.lower() | str.find() | str.strip() | A | |||||||||||||||||||
7 | 44 | What is the purpose of the str.strip() function in Python? | To split a string into a list of substrings | To remove leading and trailing white spaces from a string | To find the index of a substring within a string | To replace occurrences of a substring with another substring | B | |||||||||||||||||||
8 | 45 | Which function is used to replace occurrences of a substring with another substring in a given string in Python? | str.upper() | str.lower() | str.replace() | str.join() | C | |||||||||||||||||||
9 | 46 | What does the len() function return in Python when applied to a string? | The number of characters in the string | The number of words in the string | The number of lines in the string | The number of bytes in the string | A | |||||||||||||||||||
10 | 47 | Which method of string concatenation is used to join elements of a list into a single string in Python? | str.concat() | str.combine() | str.concatenate() | str.join() | D | |||||||||||||||||||
11 | 48 | What is the output of the following code snippet? | 'students, please, practice, Python, programs' | 'students please practice Python programs' | 'students, please, practice, Python, , programs' | 'students, please, practice, Python, ; programs' | A | |||||||||||||||||||
12 | 49 | Which function is used to find the index of the first occurrence of a substring within a string in Python? | str.upper() | str.lower() | str.find() | str.strip() | C | |||||||||||||||||||
13 | 50 | What is the purpose of the format() function in Python? | To convert a string to lowercase | To format strings based on specific parameters | To find the length of a string | To convert a string to uppercase | B | |||||||||||||||||||
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 | ||||||||||||||||||||||||||