0
anwser=str(input("Do you need a new phone? "))
if answer== "no":
print ("You are now finished. ")
else:
question1=str(input("Do you know what phone you want? ")
if question1== "no":
print("Research different phones and chose which pne you like best.")
else:
question2=str(input("Do you want to go on a contract? ")
if question2== "no":
question3=str(input("Do you have enought money to pay full price for your phone? ")
問題出在哪裏?我該如何改進?它不斷出現語法錯誤,我不知道爲什麼。使用我的python代碼
有幾個缺失的括號。你需要'foo = str(bar)',而不是'foo = str(bar'。 –
儘管'str'完全沒有必要。 –
語法錯誤告訴你什麼?另外,你應該指定什麼版本的Python,因爲2和3之間的語法略有不同。 – Keith