Commit 5853d929 by BellCodeEditor

save project

parent 270e5db9
Showing with 18 additions and 0 deletions
def price():
total = []
while True:
money = input("请输入你的价钱,退出请按q。")
if money=='q':
break
else:
try:
money=int(money)
except:
print('请输入正确的数字。')
else:
total.append(money)
print(total)
price()
\ No newline at end of file
...@@ -7,3 +7,4 @@ def new_input(): ...@@ -7,3 +7,4 @@ def new_input():
else: else:
total.append(unit) total.append(unit)
print(total) print(total)
new_input()
\ 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