IndentationError: unindent does not match any outer indentation level

后端 未结 30 2018
Happy的楠姐
Happy的楠姐 2020-11-21 07:48

When I compile the Python code below, I get

IndentationError: unindent does not match any outer indentation level




        
30条回答
  •  南笙
    南笙 (楼主)
    2020-11-21 08:43

    Since I realize there's no answer specific to spyder,I'll add one: Basically, carefully look at your if statement and make sure all if, elif and else have the same spacing that is they're in the same line at the start like so:

    def your_choice(answer):
        if answer>5:
            print("You're overaged")
        elif answer<=5 and answer>1: 
                print("Welcome to the toddler's club!")
        else:
                print("No worries mate!")
    

提交回复
热议问题