| 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 6 | |||||||||||||||||||||||||
2 | ||||||||||||||||||||||||||
3 | Sr. No. | Question | Option 1 | Option 2 | Option 3 | Option 4 | Correct Option | |||||||||||||||||||
4 | 51 | What character is used to format strings directly within the print statement in Python? | $ | % | # | {} | D | |||||||||||||||||||
5 | 52 | Which method of the list data type is used to add an element at the end of the list in Python? | append() | extend() | insert() | pop() | A | |||||||||||||||||||
6 | 53 | What is the purpose of the insert() method in Python lists? | To remove an element from the list | To add an element at a specific position in the list | To add an element at the end of the list | To remove the last element from the list | B | |||||||||||||||||||
7 | 54 | Which method is used to remove the first occurrence of a specified element from a list in Python? | append() | extend() | remove() | pop() | C | |||||||||||||||||||
8 | 55 | What does the pop() method do in Python lists? | Adds an element to the end of the list | Removes the last element from the list | Removes the first element from the list | Adds an element at a specific position in the list | B | |||||||||||||||||||
9 | 56 | Which method is used to sort the elements of a list in ascending order in Python? | sort() | reverse() | clear() | count() | A | |||||||||||||||||||
10 | 57 | my_set=set([1,2,2,3,3,4,5,6,7,8,9,9,9]) print(my_set) what will be the output of given code | {1, 2, 2,3,3, 4, 5, 6, 7, 8, 9,9,9} | {1, 2, 3, 4, 5, 6, 7, 8, 9} | {1, 2, 2,3,3, 4, 5, 6, 7, 8, 9,9,} | {1, 2, 2,3, 4, 5, 6, 7, 8, 9,9,9} | B | |||||||||||||||||||
11 | 58 | What is the purpose of the reverse() method in Python lists? | To remove all elements from the list | To count the occurrences of a specified element in the list | To reverse the order of elements in the list | To add an element at the end of the list | C | |||||||||||||||||||
12 | 59 | Which method is used to remove all elements from a list in Python? | remove() | clear() | reverse() | sort() | B | |||||||||||||||||||
13 | 60 | What method is used to find the index of the first occurrence of a specified element in a list in Python? | index() | count() | sort() | append() | 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 | ||||||||||||||||||||||||||