Commit 135612ba by BellCodeEditor

auto save

parent 892906d6
Showing with 24 additions and 22 deletions
def input_new(): import hjgy
u=[]
while True:
u=input("输入菜单价格(q退出):")
if u == "q":
break
try:
u=int(u)
except:
print("请重新输入一个数字")
else:
return u
finally:
print("*"*30)
def sum(edj):
m=0
m=m+u
return m
ge=input_new()
jkl=sum(ge)
print("价格为"+str(jkl))
\ No newline at end of file
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