代码拉取完成,页面将自动刷新
# with open('a1.txt','w',encoding='utf-8')as f:
# f.write('''老男孩是最好的学校,
# 全心全意为学生服务,
# 只为学生未来,不为牟利。
# 我说的都是真的。哈哈
# ''')
#
# with open('a1.txt',encoding='utf-8')as f:
# t = f.read()
# print(t)
#
# with open('a1.txt','a+',encoding='utf-8')as f:
# f.write('信不信由你,反正我信了.')
# f.seek(0)
# t = f.read()
# print(t)
#
# with open('a1.txt','w',encoding='utf-8')as f:
# f.write('''每天坚持一点,
# 每天努力一点,
# 每天多思考一点,
# 慢慢你会发现,
# 你的进步越来越大。''')
#
# lis = []
# s = 0
# with open('a1.txt',encoding='utf-8')as f:
# for i in f:
# dic = {}
# i = i.strip().split(' ') #i=['name:apple', 'price:10', 'amount:3', 'year:2012']['name:tesla', 'price:100000', 'amount:1', 'year:2013']
# for m in i:
# k,v = m.split(':')
# print(k,v)
# dic[k] = v
# s += int(dic['amount'])*int(dic['price'])
# lis.append(dic)
# print(lis,s)
#
# lis = []
# with open('a1.txt',encoding='gbk')as f:
# t = f.readline().split()
# for i in f.readlines():
# dic = {}
# i = i.split() #i = 0,['1', 'python', '30', '26', '单身狗']
# for m in range(len(i)):
# print(t[m],i[m])
# dic[t[m]] = i[m]
# lis.append(dic)
# print(lis)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。