Python3 Program That Determines How Many Times A Letter Shows Up In Your Name
- Brian Clark

- Dec 3, 2020
- 1 min read
Updated: Oct 12, 2021
Hello, I wanted to create a program that asks the user to put their name into the program and then finds any lower case letter in their name, then prints how many times it is in their name.
Check out the code I modified from another page and updated for python 3 below:
'''
Letter Frequency V1.0 - Python3
Description: Program will tell you which letter shows up in your name the most.
Author: Brian Clark
Date: 12/3/2020
source: https://www.sanfoundry.com/python-program-determine-many-times-given-
letter-occurs-string-recursively/
My Website: https://brianclark88.wixsite.com/mysite
'''
#name = str(input("What is your full name? : \n\n"))
def check(string,ch):
if not string:
return 0
elif string[0]==ch:
return 1+check(string[1:],ch)
else:
return check(string[1:],ch)
string=str(input("Enter A name :"))
ch=str(input("Enter character to check:"))
print("Count is:")


Comments