Commit 89e1a6e5 by BellCodeEditor

save project

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