這是我由於某種原因,我一直得到的,而語法錯誤程序,請排序這幫助我蟒蛇測試前做,而語法錯誤
#Variables
Destination = " "
MilesDest = 0
MPG = 0
GallonCost = 0
GallonsNeeded = 0
GasCost = 0
Syntel = " "
#Below begins Do-While pre-test
while Syntel != "No":
Syntel = str(input("would you like to run this program?(Yes/No)(Case-Sensitive) "))
Destination = str(input("Enter the name of your destination: "))
MilesDest = float(input("Enter the amount of miles between your starting point and your destination: "))
MPG = float(input("Enter the current MPG your car gets: "))
GallonCost = float(input("Enter the current cost for a gallon of gas: "))
GallonsNeeded = MilesDest/MPG
GasCost = GallonCost*GallonsNeeded
print("The number of gallons it takes to get to ",Destination, " is ",GallonsNeeded)
print("The cost of the trip to ",Destination, " is $",GasCost)
#Salutation
print("Thank you for using my program, good bye")
您在'Syntel = str(輸入'...'行之前的'while'語句之前缺少* 2 *關閉括號。您的縮進是一團糟,使我們很難說出您的帖子, – 2014-10-19 01:48:47
在我的第二個打印中出現語法錯誤 – Atom 2014-10-19 01:49:39
再一次查看上一行你錯過了更多的右括號 – 2014-10-19 01:50:10