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