Commit fe82c19d by BellCodeEditor

save project

parent 4c44d3da
Showing with 7 additions and 15 deletions
def total():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
try:
unit=int(unit)
except:
print("请重新输入一个数字")
else:
total.append(unit)
file1=open(r'C:\Users\lenovo\Desktop','w','encoding='utf-8'')
file1.write('小兰:12本\n')
file1.write('小丽:11本\n')
file1.write('李文:9本\n')
file1.write('张伟:16本\n')
file1.close()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment