Commit cbf0086b by BellCodeEditor

save project

parent 12de56bf
Showing with 11 additions and 4 deletions
def new_input(): def new_input():
total = [] total = 0
while True: while True:
unit=input("你想要吃什么") unit=input("请输入数字")
if=unit=="q" if unit='q':
break break
else:
total.append(unit) total.append(unit)
else:
try:
unit=int(unit)
except:
print("格式错误,输入整数!")
else:
total=total+unit
\ 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