Count characters Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times the character appears in the phrase. Ex: If the input is: n Monday

Relax

Respuesta :

Answer:

str1=str(input("Enter a character and phrase "))

count= 0

for i in range(0,len(str1)):

if str1[0]==str1[i]:

count+=1

count1=count-1

print(str1[0] + ' appears ' + 'this many times in ' + str1[1:] + ' is : ' + str(count1) )