Commit 766286c0 by BellCodeEditor

save project

parent cb7dd285
Showing with 6 additions and 4 deletions
...@@ -2,13 +2,14 @@ def new_input(): ...@@ -2,13 +2,14 @@ def new_input():
turtle = [] turtle = []
while True: while True:
price = input("请输入价格:") price = input("请输入价格:")
if price == 'q':
break
try: try:
int(price) price=int(price)
except: except:
print() print("请重新输入价格")
else: else:
if price == 'q': turtle.append(price)
break
else: else:
turtle.append(price) turtle.append(price)
print(turtle) print(turtle)
\ 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