Hi so I am just a beginner and was making some exercises and it marked my elif and else wrong with the error syntaxerror: invalid syntax.
Thanks in advance.
def lovefunc( flower1, flower2 ):
if flower1 % 2 == 0 and flower2 % 2 != 0:
print("true")
elif flower2 % 2 == 0 and flower1 % 2 != 0:
print("true")
else:
print("false")
I tried to make the indentations smaller etc. but all I tried didn’t work
>Solution :
You need to fix your indentation.
def lovefunc( flower1, flower2 ):
if flower1 % 2 == 0 and flower2 % 2 != 0:
print("true")
elif flower2 % 2 == 0 and flower1 % 2 != 0:
print("true")
else:
print("false")