我想不通爲什麼它是說這個詞的選項無效語法我所有的if語句無效的語法---蟒蛇
Options = raw_input("Would you like to Square, Cube, Multiply, or Divide? ")
If Options == "Square" or Options == "square":
Square = int(raw_input("What number would you like to Square? "))
Answer1 = Square ** 2
print "The answer is :%d" %Answer1
if Options == "Cube":
Cube = int(raw_input("What number would you like to Cube "))
Answer2 = Cube ** 3
print "The answer is :%d" %Answer2
if Options == "Multiply":
Multiply1 = int(raw_input("What is the first number to multiply? "))
Multiply2 = int(raw_input("What is the second number to multiply? "))
Answer3 = Multiply1 * Multiply2
print "The answer is :d%" %Answer3"
閱讀基本的Python教程在這裏會很有幫助 – 2012-08-02 18:05:08
中斷器指向錯誤所在的位置。利用此功能。 – 2012-08-02 18:07:23