Suppose I have a list ['', 'Tom', 'Jane', 'John', '0'], and I wrote the following to check if it has empty string '':
if any('' in s for s in row[1:]):
print "contains empty string, continue now"
continue
I expect this to only pick the empty string, but this also picks a list that contains '0'. The '0' string is valid and I do not want to filter it out. So how can I check for an empty string in a python list?
'' in s->s == ''(or more triviallyif '' in row)