Commit 591e41af by BellCodeEditor

save project

parent 05e7d622
file1=open(r'"C:\Users\刘龙佳\Desktop\123.txt"'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
try:
age = int(input('114514'))
except:
print('1919810')
print('123242345235')
\ No newline at end of file
file1=open(r'D:\123.txt','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
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("输入")
else:
total.append(unit)
finally:
print("_"*30)
return total
def sum(unit):
count=0
for i in unit:
count = count+i
return count
price=new_input()
pay=sum(price)
print("一共"+str(pay)+"元快付钱")
\ 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