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:
But I tried with one another attempt:
But this code does not give me the correct answer if I try for example
What is wrong?!
The correct code is:
1 2 3 4 5 6 |
def has_no_e(letter): for i in letter: if i = = 'e' : return False return True |
1 2 3 4 5 6 |
def has_no_e2(letter): for i in letter: if i! = 'e' : return True return False |
1 |
print (has_no_e2( 'Robert' )) |