Write a Python program that does the following.
string = 'dog cat bird mouse cow horse hen tiger elephant dolphin snake giraffe lion lynx rhino'
L = string.split()
print('Original list:')
print(L, '\n')
print('Popping the last element:')
L.pop()
print(L, '\n')
print('Delating 3th element:')
del L[2]
print(L, '\n')
print("Removing 'elephant':")
L.remove('elephant')
print(L, '\n')
Comments
Leave a comment