2017-10-22 11 views
-4
count=0 
count2=0 
print(header) 
def countWord():  
    for i in f1sen: 
     count= len(re.findall(r'\w+', i)) #command to count all the words 
     print(i,"Number of words: ",count) 
    for j in f2sen: 
     count2= len(re.findall(r'\w+', j)) #command to count all the words 
     print(j,"Number of words: ",count2) 

でインデントと私はそれを実行しようとすると、それは私に次のエラーを与える:のpython3

File "C:\Users\George\Documents\Programming for digital Humanities\Assignment 3\assig3.py3", line 48 
    for j in f2sen: 
       ^
IndentationError: unindent does not match any outer indentation level 
[Finished in 0.2s] 

誰かが私はこの問題を解決するのに役立つだろうか? ありがとうございました

+1

この行の前後のスペースを確認してください。 – alfasin

答えて

0

問題が見つかりました。インデントを作成するために、スペースボタンを押すと、タブを押すこととは異なります。私はPythonで新しいので、私はそれを認識していませんでした。したがって、同じように見えるかもしれないが、コンパイルがエラーとして解釈するので、タブを使用してインデントを作成します。