Question: In python 4) Write a program to count the number of occurrences of a user-entered character within a string. For this exercise, use the .split(
4) Write a program to count the number of occurrences of a user-entered character within a string. For this exercise, use the .split( ) method to create a list that each word is a list item. - Write a function (count (st, x) where st is the string, and x is the user-entered character count ( st, x) returns the number of occurrences of the character entered. For example st = "This is very hot and humid in Memphis" x= user entered (using input(" enter the character that you want to count in the string") Pass this string (st) to count(st, x ) Result: string = This is very hot and humid in Memphis enter the character that you want to count in the string h there are 4 char " h " in the string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
