python remove digits from list code example
Example 1: remove all integers from list python
no_integers = [x for x in mylist if not isinstance(x, int)]
Example 2: remove element from list python
# animals list
animals = ['cat', 'dog', 'rabbit', 'guinea pig']
# 'rabbit' is removed
animals.remove('rabbit')
# Updated animals List
print('Updated animals list: ', animals)