2015-05-02 29 views
-4

我正在做一個計算機科學項目的編碼拼圖。計算機科學項目的編碼拼圖

我做得不錯,直到我遇到縮進塊錯誤。它是在線63.

任何幫助將是輝煌!

下面是代碼:

#check to see if letters used 
while True: 
    try: 
     x=words.index(answer1) 
     answer2=raw_input('Now please type the letter you wish to replace it with') 
     words=words.replace(answer1,answer2) 
    except ValueError: 
     print "there is an error using this letter/symbol, try again" 
     break 
    answer2=raw_input('Now please type the letter you wish to replace it with') 
    words=words.replace(answer1,answer2) 
    if words==check: 
     print"Congratulations" 
    else: 
     #routine to delete a previous guess 


     #find #if answer1=="+": 
       #if answer2=="C" 
       # +=C 
     #words2=words.replace(answer1,answer2)   
+0

哪一個是該代碼示例中63行? – ODiogoSilva

+1

任何想法63行是?我的猜測是:你註釋掉了'else'子句中的所有行,並沒有使用'pass'語句。 – Carsten

回答

0

的問題是與else塊。在Python中,縮進很重要,所以沒有塊可以完全空白。如果else聲明的目的是什麼都不做,寫

else: 
    pass