Commit bcb2b132 by BellCodeEditor

save project

parent cebee45e
Showing with 4 additions and 27 deletions
def new_input(): filel=open(r"C:\Users\kldg\Desktop\txt",'w',encoding='utf-8')
total = [] filel.write('小兰:12本\n小丽:11本\n李文:9本\n张伟:16本\n')
while True: filel.close()
unit= input("请输入:") \ No newline at end of file
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("请输入数字")
else:
total.append(unit)
print('-'*30)
print(total)
return total
def summ(money):
su=0
for i in money:
su=i+su
return su
# price=new_input()
# a=sum(price)
# print(a)
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