摘要:
一:文件指针 强调:只有t模式下read(n),n代表字符个数,除此之外都是以字节为单位 with open('a.txt',mode='rt',encoding='utf-8') as f: #文本模式打开文件,按字符读取 res=f.read(4) print(res)、 with open(' 阅读全文
摘要:
1.for循环 和while相比 l=[1,2,3] i=0 while i <len(l) print(l[i]) i+=1 l=['a','b','c'] for item in l: print(item) 字典中的应用: dic={'x':111,'y':222,'z':333} for k 阅读全文