Is_even


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/2?curriculum_id=4f89dab3d788890003000096#


The console returns an invalid syntax and highlights the =


I expect it to return true


def is_even(x) =
    if x % 2 = 0:
        return True
    else:
        return False


#2

Did you mean to write,

def is_even(x):

?

if x % 2 == 0:

Single = is an assignment.


#3

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