Deleting item from a list

The function returns the updated list. It doesn’t modify the list in place.