Question 1 of 25
Hints left: 3
Q1
What is the purpose of the remove() method for lists and tuples?
Q2
In Python, how can you copy the elements of one list or tuple into another?
Q3
In Python, how can you join two or more lists or tuples together?
Q4
What is the purpose of the list() constructor in Python?
Q5
What will be the output of the following code: my_list = [1, 2, 3] my_list.reverse() print(my_list)
Q6
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
Q7
What is the purpose of the clear() method for lists and tuples?
Q8
What will be the output of the following code: my_tuple = (1, 2, 3) my_tuple[1] = 4 print(my_tuple)
Q9
What will be the output of the following code: my_list = [3, 1, 2] my_list.sort() print(my_list)
Q10
How can you add an element at the end of a list or tuple in Python?
Q11
Which method is used to remove the first occurrence of a specific element in a list or tuple?
Q12
Which method is used to remove the last element from a list or tuple?
Q13
In Python, how can you check if an element exists in a list or tuple?
Q14
What is the output of the following code: my_tuple = (1, 2, 3) print(my_tuple[1])
Q15
In Python, how can you find the index of a specific element in a list or tuple?
Q16
Which method is used to count the occurrences of an element in a list or tuple?
Q17
In Python, how can you remove all occurrences of a specific element from a list or tuple?
Q18
Which method is used to sort the elements of a list or tuple in ascending order?
Q19
In Python, how can you extend a list or tuple by adding elements from another iterable?
Q20
What is the purpose of the count() method for lists and tuples?
Q21
What is the output of the following code: my_list = [1, 2, 3, 4] my_list.pop() print(my_list)
Q22
What is the purpose of the reverse() method for lists and tuples?
Q23
What is the output of the following code: my_list = [1, 2, 3] my_list.append(4) print(my_list)
Q24
What is the output of the following code: my_list = [1, 2, 3, 4, 5] print(my_list[1:4])
Q25
What is the output of the following code: my_list = [1, 2, 3] del my_list[1] print(my_list)