Commit f75345c9 by BellCodeEditor

save project

parent dc70412a
Showing with 27 additions and 0 deletions
def new_input():
total = []
while True:
unit=input("请输入:q退出")
if unit=='q':
break
else:
try:
unit=int(unit)
except:
print("输一个数")
else:
total.append(unit)
print("当前菜单价格为:"+str(total))
return total
price=new_input()
def clac(price):
sum=0
for i in price:
sum+=i
return sum
count=clac(price)
print('总价:'+str(count))
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