复习map\filter\reduce\file
# # # s=[1,2,3,4] # # # print(list(map(str,s)))#字符串输出 # # from functools import reduce#reduce 需要导入 # # s=[1,2,3,4] # # res=reduce(lambda x,y:x+y,s,3) # # print(res) # name=['ali','blia'] # res=filter(lambda x: not x.endswith('a'),name) # print(list(res))#过滤掉a结尾的 f=open('eze.py','a+',encoding='utf-8')#读写 # data=f.read() # print(data) f.write('你好,这是a+内容') f.close()