IndentationError: unindent does not match any outer indentation level

来源:互联网 发布:单片机类型 编辑:程序博客网 时间:2024/05/21 03:20

python 2.7代码运行出现IndentationError: unindent does not match any outer indentation level

示例代码:

def cmp_ignore_case(s1, s2):

     u1 = s1.upper()
    u2 = s2.upper()
    if u1 < u2:
        return -1
    if u1 > u2:
        return 1
    return 0
    
print sorted(['bob', 'about', 'Zoo', 'Credit'], cmp_ignore_case)

由于u1变量和u2变量代码缩进没有对齐


阅读全文
0 0