str = input("Enter the string: ") ch = input("Enter the character to count: "); c = str.count(ch) print(ch, "occurs", c, "times")
OUTPUT:–
Enter the string: chaselearn Enter the character to count: a a occurs 2 times
str = input("Enter the string: ") ch = input("Enter the character to count: "); c = str.count(ch) print(ch, "occurs", c, "times")
OUTPUT:–
Enter the string: chaselearn Enter the character to count: a a occurs 2 times