1
這是有點我的功課,我堅持讓代碼成爲後續問題,就像這裏的代碼一樣,我試過在if語句之後插入if語句,但它給了我一個意想不到的出現錯誤。if語句中的if語句
這裏是我的代碼至今:
Choice = input("Hello! Do you want to buy or sell snakes? Please enter (b) or (s) :")
if Choice == "b":
buySnake = input ("What snake do you want to buy? We are selling python, kingsnake, rattlesnake, deathadder, cobra, mamba, viper and gartersnake. Please choose one : ")
if buySnake == "python":
return (to be added)
elif Choice == "s":
sellFsnakes(snakeList,name,amount)
else:
print("Please try again.")
buyWsnakes(snakeList,name,amount)
如果它說有一個意外的縮進,你看了看那條線的縮進,並考慮它是否可以站得住腳嗎? – TigerhawkT3