Here I tried the following:
def letter_check(word, letter):
for char in word:
if char == letter:
return True
else:
return False
But when the program checks against letter_check("strawberry", "a")
it returns False
.
APPARENTLY it wants the following code despite returning False
is not inline with the if statement. Can anyone tell me why this is?
def letter_check(word, letter):
for character in word:
if character == letter:
return True
return False