# The definition of the function
def returnLetterCount(aString,letterToFind):
# We keep a track for counting the number of occurences of lettertofind
count=0
for character in aString:
# If the character is equal to the lettertofind we increment count by 1
if character==letterToFind:
count+=1
return count
print(returnLetterCount("ababa","a"))
print(returnLetterCount("sasabbbbbcccccrererere","s"))
print(returnLetterCount("qwerty","q"))
print(returnLetterCount("apple","s"))
Hope this helps you..
In case of any queries feel free to ask in the comments section
Happy Coding :) :)
New Arrivals-Princess Polly USA Ho Schedules ietz - Computational Reasoning 1 Fall 2019/ INFO1201-F19 /21 October...