2014-10-19 37 views
0

我有這樣的代碼:EOL掃描字符串文字Python任何指針?

GDP=input(int("what is the exchange rate for the pound today?")) 
USD=input(int("what is the exchange rate for the dolar today?")) 
print("thank you") 

menu = "What would you like to exchange today?:\n\1.dolar to pound\n\ 
    \n\2.pound to dolar\n\ 
    answer == int(input(menu) 

if answer == 1: 
    amount1 = input(int("how much would you like to convert?")) 
    print(amount1/GDP= answer1 +(2% answer1=answer2) 
      print(answer2"is the amount of money") 

if answer == 2: 
    amount2= input(int("how much would you like to convert?")) 
    print(amount2/USD=answer3 +(2% answer3=answer4) 
    print (answer4"is how much money") 

和它說:EOL同時掃描字符串文字誰能幫助我不知道什麼是錯的

+4

你忘了關閉的引號( s)的菜單分配。 – 2014-10-19 16:16:51

+3

可以很容易地注意到奇怪的語法突出顯示... – 2014-10-19 16:17:21

回答

1

要創建一個多串,用三引號("""):

multiline_string = """This is a 
        multiline string""" 
0

您未能收上

menu = 
報價

你未能收上

answer = 

的括號而你在該行,你應該使用使用== =

-1

正確的是這樣的:

GDP=input(int("what is the exchange rate for the pound today?")) 
USD=input(int("what is the exchange rate for the dolar today?")) 
print("thank you") 

menu = "What would you like to exchange today?:\n\1.dolar to pound\n\ 
\n\2.pound to dolar\n\" ### see here 
answer == int(input(menu)) ### see here 

if answer == 1: 
amount1 = input(int("how much would you like to convert?")) 
print(amount1/GDP= answer1 +(2% answer1=answer2) 
     print(answer2"is the amount of money") 

if answer == 2: 
amount2= input(int("how much would you like to convert?")) 
print(amount2/USD=answer3 +(2% answer3=answer4) 
print (answer4"is how much money") 
+0

沒有任何描述,你迫使讀者逐個字符地看看你改變了什麼。如果你們都告訴答案是什麼,那麼你的答案會更有用,並顯示代碼。 – 2014-10-19 17:25:15