I know that the 'one line if statement' question has been asked multiple times already but I couldn't figure out what's wrong with my code. I want to convert
def has_no_e(word):
if 'e' not in word:
return True
to a one line function like:
def hasNoE(word):
return True if 'e' not in word
but I get a Syntax Error if I do so -why?