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