l=["Emma", "Jon", "", "Kelly", None, "Eric", ""] r=[] for i in l: if(not (i=='' or i==None)): #if(i) this check for non empty string in list r.append(i) print(r)
To embed this project on your website, copy the following code and paste it into your website's HTML: