迭代,列表,字典,文件迭代
for i in k :i=k_iter_()
# f=open('dog.txt','r',encoding='utf8')#如果文件不存在可以新建文件
# f.seek('你好',1)#通过seek光标查找
# print(f.tell())
# 迭代:for循环遵循迭代器,只能往前走不能往后退,
# k=[1,2,3]
# for i in k:#i=k._iter_()
# print(i)
# k = [1, 2, 3, 4]
# # print(k[0])
# index = 0
# while index < len(k):
# print(k[index])
# index += 1
# dic={'a':2,'b':7}#字典迭代
# res=dic.__iter__()
# print(res.__next__())
f=open('eze.py','r+')#文件迭代操作
#for i in f
res=f.__iter__()
print(res.__next__(),end='2')
k = [1, 2, 3, 4]#列表迭代
# iter_1=k.__iter__()#遵循迭代器协议生产可迭代对象
# print(iter_1.__next__())#取对象列表的值
# print(iter_1.__next__())#取对象列表的值