First page Back Continue Last page Overview Graphics

The Letter ā€žEā€œ

Exercise:

Write a function which counts the numbers of ā€žeā€œ in a string.

def number_of_es(str):

counter = 0

for letter in str:

if letter == "e":

counter += 1;

return counter

str =" "

while str:

str = input("Type in String: ")

print(number_of_es(str.lower()))