python list remove all empty elements code example Example: python remove empty list list2 = filter(None, list1)