My goal is to write a function that takes a letter as an argument, it loops through its words and gives me False if it contains 'e' otherwise it is True.
The correct code is:
The correct code is:
def has_no_e(letter):
for i in letter:
if i=='e':
return False
return TrueBut I tried with one another attempt:def has_no_e2(letter):
for i in letter:
if i!='e':
return True
return FalseBut this code does not give me the correct answer if I try for example print(has_no_e2('Robert'))What is wrong?!
