Commit 7d7cf58a by BellCodeEditor

save project

parent b536ccf5
Showing with 8 additions and 3 deletions
...@@ -2,9 +2,15 @@ def 价格(): ...@@ -2,9 +2,15 @@ def 价格():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
print('-'*30)
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
a=int(unit)
except:
print('请输入一个整数')
else:
total.append(a)
print(total) print(total)
价格() 价格()
\ 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