Question 1 of 25
Hints left: 3
Q1
What is the purpose of the list() constructor in Python?
Q2
What method is used to insert an element at a specific index in a list?
Q3
What is the purpose of the clear() method for lists?
Q4
Which method is used to remove the first occurrence of a specific element in a list?
Q5
In Python, how can you check if an element exists in a list?
Q6
What is the purpose of the count() method for lists?
Q7
What will be the output of the following code: my_list = [1, 2, 3] my_list[1] = 4 print(my_list)
Q8
What is the output of the following code: my_list = [1, 2, 3, 4] my_list.remove(2) print(my_list)
Q9
What will be the output of the following code: my_list = [3, 1, 2] my_list.sort() print(my_list)
Q10
In Python, how can you remove all occurrences of a specific element from a list?
Q11
What is the output of the following code: my_list = [1, 2, 3, 4, 5] print(my_list[1:4])
Q12
What will the following code output: my_list = [1, 2, 3] new_list = my_list.copy() print(new_list)
-
A
-
B
-
C
-
D
Q13
In Python, how can you join two or more lists together?
Q14
How can you add an element at the end of a list in Python?
Q15
What is the output of the following code: my_list = [1, 2, 3] my_list.insert(1, 4) print(my_list)
-
A
-
B
-
C
-
D
Q16
What is the output of the following code: my_list = [1, 2, 3] print(my_list[1])
Q17
In Python, how can you copy the elements of one list into another?
Q18
What is the output of the following code: my_list = [1, 2, 3] my_list.append(4) print(my_list)
Q19
In Python, how can you find the index of a specific element in a list?
Q20
Which of the following is the correct way to create an empty list in Python?
Q21
What does the len() function do when applied to a list?
Q22
What is the purpose of the remove() method for lists?
Q23
Which method is used to remove the last element from a list?
Q24
Which method is used to count the occurrences of an element in a list?
Q25
In Python, how can you extend a list by adding elements from another iterable?