In this example we will show how to remove an element from the array using the remove() method in Python.
Source Code
letter = ['a', 'b', 'c', 'd']
print(letter)
letter.remove('c')
print(letter)
Output:
['a', 'b', 'c', 'd']
['a', 'b', 'd']
In this example we will show how to remove an element from the array using the remove() method in Python.
letter = ['a', 'b', 'c', 'd']
print(letter)
letter.remove('c')
print(letter)
Output:
['a', 'b', 'c', 'd']
['a', 'b', 'd']
In this example we will show how to remove an element from the array using the pop() method in Python.
letter = ['a', 'b', 'c', 'd']
print(letter)
letter.pop(2)
print(letter)
Output:
['a', 'b', 'c', 'd']
['a', 'b', 'd']