python if list is empty delete list code example Example: python remove empty list list2 = filter(None, list1)