[英]IndentationError: expected an indented block 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
您必須在python中的if塊上添加縮進。
total = 0;
for i in range (a_lenght):
if(a[i] == u[0]):
end = i + u_length;
if (a[i:end] == u):
total +=1;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.