#filter函数实现过滤
##版本一 最简单使用生成器加条件
#实现过滤空字符串 版本一
a_list = ['', 'home', 'usertest1']
t = [ s for s in a_list if len(s)>0 ]
##版本二 也可以使用filter + lambda + 条件
a_list = ['', 'home', 'usertest1']
b_list = list(filter(lambda x: x in a_list and len(x)>0, iterator(a_list))
while True:
try:
prnt(next(b_list))
except StopIteration:
print("StopIteration")
break