Commit 37745e10 by BellCodeEditor

save project

parent a0ec4b66
Showing with 19 additions and 3 deletions
while True:
try:
abc=int(input('价格'))
except:
print('整数!')
print('结束')
else:
...@@ -4,6 +4,14 @@ def abc(): ...@@ -4,6 +4,14 @@ def abc():
unit = input('') unit = input('')
if unit == 'q': if unit == 'q':
break break
else:total.append(unit) else:
try:
unit=int(unit)
except:
print('整数!')
else:
total.append(unit)
finally:
print('-'*30)
print(total) print(total)
nidie() abc()
\ 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