how to remove empty elements from a list in python code example Example: python remove empty list list2 = filter(None, list1)