Created
February 6, 2017 22:41
-
-
Save shamikalashawn/d854a5f15a23a7dc6ef2968c2a60dc53 to your computer and use it in GitHub Desktop.
Given a string and a letter, a number of times that letter appears in the string is returned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def count(string, letter): | |
thecount = 0 | |
for item in string: | |
if item == letter: | |
thecount = thecount + 1 | |
print (thecount) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment