Conditionals & Control Flow :The Big if


#1

AA = "Hello"
AB = "Hihi"
AC = "Syntax"
AD = "World"
def the_flying_circus():
    # 여기서 부터 코딩을 시작하세요!
    if len(AA) == len(AD) and len(AA) >= len(AC):
        return True
        elif len(AA) * len(AD) >= len(AC) * len(AB):
            return True
            else:
                return False

What's wrong?
I need a solution.


#2

Your elif statement is nested in your if statement, and your else statement is nested in your elif statement. These statements should be at the same indentation level to work as one if/elif/else statement.
Simply correct your indentation, and you'll be good to go!

if _____:
    # Do something
elif ____:
    # Do something else
else:
    # Do something else

#3

Indentation, The code block needs to be arranged properly and whitespaces need to be managed.

AA = "Hello"
AB = "Hihi"
AC = "Syntax"
AD = "World"
def the_flying_circus():
    # 여기서 부터 코딩을 시작하세요!
if len(AA) == len(AD) and len(AA) >= len(AC):
        return True
elif len(AA) * len(AD) >= len(AC) * len(AB):
        return True
else:
        return False

#4

Sorry, just quick, but watch the indentation of your code inside the statements. They're indented too far forward, so bring them back 1 indent.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.