Commit cdfbca5e by BellCodeEditor

save project

parent 6d88eca4
Showing with 29 additions and 0 deletions
# total = []
# while True:
# unit= input("请输入:")
# if unit== 'q':
# break
# else:
# total.append(unit)
# print(total)
def put_money_into_wallet():
wallet=[]
while True:
put_money=input("输入整数价格:(按'q'退出)")
if put_money=="q":
print("已退出")
break
try:
int(put_money)
wallet.append(put_money)
print("当前钱包内有:"+str(",".join(wallet)))
except:
print("记得输入整数")
print("-"*30)
print("当前钱包内有"+str(",".join(wallet)))
return wallet
result_of_wallet=put_money_into_wallet()
print(result_of_wallet)
\ 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