摘要:
# def demo():# for i in range(4):# yield i## g=demo()## g1=(i for i in g)# g2=(i for i in g1)## print(list(g))# print(list(g1))# print(list(g2))def ad 阅读全文
摘要:
3.处理文件,用户指定要查找的文件和内容,将文件中包含要查找内容的每一行都输出到屏幕def check_file(filename,aim): with open(filename,encoding='utf-8') as f: #句柄 : handler,文件操作符,文件句柄 for i in f 阅读全文
摘要:
# 双下方法# print([1].__add__([2]))# print([1]+[2])# 迭代器# l = [1,2,3]# 索引# 循环 for# for i in l:# i## for k in dic:# pass# list# dic# str# set# tuple# f = o 阅读全文