remove an element from list and return code example
Example 1: how to delete a particular element from a list in python
# animals list
animals = ['cat', 'dog', 'dog', 'guinea pig', 'dog']
# 'dog' is removed
animals.remove('dog')
# Updated animals list
print('Updated animals list: ', animals)
Example 2: how to remove a element from list in python and print it
pop(n) removes the element at the given index number and can print it