输出固定函数
>>> with open(r'd:\test.txt','r') as f: for i , v in enumerate(f): if i>10: break print(v)
i,v分别是迭代的索引和值