1 Star 0 Fork 0

老男孩教育Python全栈26期/19083026059

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
da08.py 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
谢一峰 提交于 2019-11-05 21:07 . day39
# 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)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/oldboy-python-full-stack-26/19083026059.git
git@gitee.com:oldboy-python-full-stack-26/19083026059.git
oldboy-python-full-stack-26
19083026059
19083026059
master

搜索帮助