Commit 89e1a6e5 by BellCodeEditor

save project

parent 994c4817
Showing with 11 additions and 13 deletions
def fun(): def fun():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入价格(按q退出):")
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
print(total) b=int(unit)
try: except:
unit=int(input("请输入:")) print('请重新输入数字')
except: else:
print('要输入整数哦~~') total.append(b)
else: print(total)
if unit== 'q': return total
break fun()
else: \ No newline at end of file
total.append(unit)
print(total)
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