2013-10-27 104 views
0

这里是我的代码IndentationError:预计缩进块13

def count (a, e, i, o, u): 
    a_length = len(a); 
    e_length = len (e); 
    i_length = len (i); 
    o_length = len (o); 
    u_length = len (u); 

    total = 0; 
    for i in range (a_lenght): 
     if(a[i] == u[0]): 
     end = i + u_length; 

     if (a[i:end] == u): 
     total +=1; 

这里是错误

错误隐藏输出

• File "submission.py", line 11 
    end = i + u_length; 
^
IndentationError: expected an indented block 
+0

对于其中一个,'if:'应该跟着更多的缩进行。你在这里没有差别。 –

回答

4

您必须添加缩进如果蟒蛇块。

total = 0; 
for i in range (a_lenght): 
    if(a[i] == u[0]): 
     end = i + u_length; 

    if (a[i:end] == u): 
     total +=1; 
相关问题