filter会将函数中返回的结果为True对应的参数值“过滤出来”
过滤出来的值会添加到filter对象中
name_list = ["123we","234we","dbgwe","tank"]
filter_obj = filter(lambda name:name.endswith("we"),name_list)
print(filter_obj) #运行结果为<filter object at 0x000002939CF984C8>
print(list(filter_obj)) #['123we', '234we', 'dbgwe']
print(tuple(filter_obj)) #()
从这几个例子中可以看到用列表打印出来才会有函数的filter对象。原因还要再查。