Possible Duplicate:
Python 3.2.3 programming…Almost had it working爲什麼不Python的這項工作3.2.3
x = float(input("What is/was the cost of the meal?"))
y = float(input("What is/was the sales tax?"))
z = float(input("What percentage tip would you like to leave?"))
print ("Original Food Charge: ${}"
.format(x)))
print ("Sales Tax: ${}"
.format((y/100)*x)))
print ("Tip: ${}"
.format(x*(z/100)))
print ("Total Charge For Food: ${}"
.format(x+((y/100)*x)+((z/100)*x)))
輸出錯誤:
線10條,在 語法錯誤:.format(X))):行1015
有人報告說,這在他們早期版本的python(我認爲是v2.6)中有效。我正在使用後來的3.2.3版本,並且絞盡腦汁地想知道爲什麼這個版本無法使用。這對我有意義,請讓我注意。
編輯你原來的問題,,問在同一問題在不同的問題不會幫助... – avasal
我編輯了我原來的問題,它是完全更新。它似乎被忽略了,正在回答我的問題的程序員之一建議我重新發布我的代碼以進行分析。 – user1693293
@ user1693293現在按預期工作嗎? –