Commit 3b147589 by BellCodeEditor

save project

parent 8dab391f
Showing with 12 additions and 8 deletions
total = []
def func(): def func():
total = []
while True: while True:
try: try:
unit=int(input("请输入:")) unit=input("请输入:")
a=int(unit)
except: except:
if unit=='q':
break
else:
print("重输,笨蛋") print("重输,笨蛋")
else: else:
if unit== 'q': if unit=='q':
break break
else: total.append(a)
total.append(unit) return total
print(total) total=func()
func() print(total)
\ No newline at end of file \ 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