list1 = ["apple" , "banana", "cherry"]
list1. pop()
print(list1)
Answers
Answered by
2
Correct code:
Answer:
Explanation:
is a method that removes an element from a list. It returns the element as output as well, and when the updated list is printed, the element is removed.
The method takes index values as arguments and performs accordingly. Since there was no index value mentioned, the last element of the list is removed by default. Hence, here, 'cherry' was removed from the list.
Another example to explain the working:
As seen above, the element with index value 1 is being removed. It is first returned as output and when the list is printed again, you'll observe that the element is removed.
Similar questions