Give an example to remove list element.
Answers
Answered by
2
Answer:
Python Programming Certification is one of the most sought after certifications in the market. The reason for this is the array of functionalities Python offers. Lists are one collection that simplifies the life of programmers to a great extent.
Python List remove()
The remove() method removes the first matching element (which is passed as an argument) from the list.
Answered by
0
An example in Python language to remove list element is:
fruits = ['apple', 'guava', 'banana', 'grapes']
fruits.remove('banana')
print ( fruits )
- This code give the output as shown below-
[ 'apple' , 'guava' , 'grapes' ]
- The remove ( ) is a list method.
- The remove ( ) method is used to remove the element from the list that has been passed as an argument.
Similar questions
Science,
5 months ago
Business Studies,
5 months ago
Computer Science,
5 months ago
Computer Science,
11 months ago
English,
11 months ago
English,
1 year ago