Commit cbf0086b by BellCodeEditor

save project

parent 12de56bf
Showing with 12 additions and 6 deletions
def new_input():
total = []
total = 0
while True:
unit=input("你想要吃什么")
if=unit=="q"
unit=input("请输入数字")
if unit='q':
break
total.append(unit)
else:
total.append(unit)
\ No newline at end of file
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