Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 3)
3.
What will be the output of the following code snippet?
fruits = ['apple', 'banana', 'cherry']
fruits.remove('banana')
print(fruits)
['apple', 'banana', 'cherry']
['apple', 'cherry']
['banana', 'cherry']
Error
Answer: Option
Explanation:
The remove() method is used to remove a specific element from the list.
fruits = ['apple', 'banana', 'cherry']
fruits.remove('banana')
print(fruits)
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.