Can somebody tell me what's wrong with my syntax? The instructions also say that the final result has to output the value "True"


#1

https://www.codecademy.com/en/courses/python-beginner-BxUFN/4/1?curriculum_id=4f89dab3d788890003000096

File "python", line 10
else chicken>5:
^

SyntaxError: invalid syntax


I expected the code to run just fine.

def the_flying_circus(chicken):
 if chicken>4 and 3<4:
    return "haha you silly guy!"
 elif chicken<=5:
    return "True"
else chicken>5:
return "Nope"

#2

The syntax for your else statement is invalid.

Else statement example:

if condition:
    do something in here
else:
    default condition

#3

Thanks man! I ended up getting it once I looked back into previous lessons.


#4

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