Commit fcc64e8a by BellCodeEditor

auto save

parent dc70412a
Showing with 44 additions and 0 deletions
def new_input():
total=[]
while True:
unit=input("请输入菜品价格:")
if abc=='q':
break
else:
try:
unit=int(unit)
except:
print("请输入一个整数")
else:
total.append(abc)
print('*'*30)
return total
xyz=new_input()
print(xyz)
\ 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)
print('*'*30)
return total
xyz=new_input()
print(xyz)
def sum(list1):
summ=0
for i in list1:
summ+=i
return summ
fin=sum(xyz)
print("您一共消费了",fin,"元!扫码还是现金呢?")
\ 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