Commit 42f76e29 by BellCodeEditor

save project

parent 05e7d622
def input_new():
u=[]
while True:
list1=input("输入菜单价格(q退出):")
if list1 == "q":
break
try:
list1=int(list1)
u.append(list1)
except:
print("请重新输入一个数字")
finally:
print("*"*30)
return u
def sum(edj):
m=0
for i in edj:
m=m+i
return m
ge=input_new()
jkl=sum(ge)
print("价格为"+str(jkl))
\ 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