if a list is empty , delete it and also delete location in python code example Example: python remove empty list list2 = filter(None, list1)