为了账号安全,请及时绑定邮箱和手机立即绑定

求大神帮忙解释下unindent does not match any outer indentation level是什么意思?

>>> score = 85

>>> if score    >=90:

print 'excellent'

    elif score  >=80:

   

  File "<pyshell#25>", line 4

    elif score  >=80:

                    ^

IndentationError: unindent does not match any outer indentation level


正在回答

4 回答

elif与if对齐,并且下一行的print语句应该比elif多四个空格。

if score >= 90:
    print 'excellent'
elif score >= 80:
    print 'good'
elif score >= 60:
    print 'passed'
else:
    print 'failed'


0 回复 有任何疑惑可以回复我~

你的 elif 应该对齐 if

0 回复 有任何疑惑可以回复我~

 if score    >=90:

print 'excellent'

    elif score  >=80:

缩进不正确


0 回复 有任何疑惑可以回复我~
#1

慕村0344109 提问者

那应该怎么样缩进呢?
2017-09-11 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
初识Python
  • 参与学习       758770    人
  • 解答问题       8657    个

学python入门视频教程,让你快速入门并能编写简单的Python程序

进入课程

求大神帮忙解释下unindent does not match any outer indentation level是什么意思?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信