Commit 4baba8c3 by BellCodeEditor

save project

parent 1775a62d
Showing with 12 additions and 4 deletions
def new_input():
g=[]
while true:
unit=input("你要点什么菜")
g=0
while True:
unit=input("请输入数字")
if unit=="p":
break
else:
g.append(unit)
try:
unit1=int(unit)
except:
print("格式错误,输入整数!")
else:
g=g+unit1
return g
c=new_input()
print(c)
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