Respuesta :
Answer:
# how many char in phrase
# input string of character and phrase
user_string = input(str())
# determine location of character is in phrase
character = user_string[0]
phrase = user_string[1:]
# output # of times character is in phase
if character in phrase:
num_occur = phrase.count(character)
print(num_occur)
if character not in phrase:
print(0)
Explanation:
This is the Zybooks answer in correct format
The program counts the number of times a certain alphabet occurs in a particular sentence or word supplied by user. The program is written in python 3 thus :
user_input = input('Enter phrase : ')
#prompts user for input
char_to_count = user_input[0]
#subset the letter to count as it is the first of the input string
word = user_input[1:]
#subset the word
num_counts = word.count(char_to_count)
#count the number of times the alphabet occurs using the count function
if char_to_count in word :
#check if the character to count occurs in the word
print(num_counts)
#display the number of times in occurs
else :
print(0)
#ifit doesn't occur print 0
Learn more : https://brainly.com/question/14942732