Commit c3e13dda by BellCodeEditor

auto save

parent 7eaed43a
Showing with 28 additions and 0 deletions
goods=
\ No newline at end of file
def func():
def func():
total = []
while True:
unit = input("请输入菜品价格")
if unit == 'q':
break
else:
try:
uint = int(unit)
except:
print("请输入正确的整数!")
else:
total.append(unit)
return total
total = func()
def sum(price):
count = 0
for i in price:
count = count + int(i)
return count
price = sum(total)
print(price)
\ 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