Commit 02acf5ce by BellCodeEditor

save project

parent 61b13441
Showing with 16 additions and 11 deletions
def eat(): def eat():
total = [] total = []
while True: while True:
try: unit = input("请输入(按q退出):")
unit = int (input("请输入:")) if unit== 'q':
if unit== 'q': break
break else:
else: try:
total.append(unit) unit = int(unit)
finally: except:
print("请输入整数")
print(total) else:
eat() total.append(unit)
\ No newline at end of file finally:
print("-"*30)
return total
z = eat()
print(z)
\ 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