Commit 6988e11e by BellCodeEditor

save project

parent a882538e
Showing with 23 additions and 10 deletions
......@@ -14,17 +14,30 @@ total = []
# print('要输入整数啊!!')
# print('程序结束~~')
#_________________________________________2
try:
age=int(input('价格'))
except:
print('要输入整数啊!!')
else:
# try:
# age=int(input('价格'))
# except:
# print('要输入整数啊!!')
# else:
print('total')
print('_'*30)
# print('total')
# print('_'*30)
#__________________________________________________3
def new_input():
total=[]
while True:
price=input("请输入价格~")
try:
p=int(price)
except:
print("请输入一个整数~")
else:
total.append(p)
if price=="p":
break
print(total)
print('-'*30)
new_input()
......
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