Write a function that takes 2 strings as its parameters, with one of them being a single character and the other a sentence. The function should return the number of times that character is found within the sentence. The function is case sensitive.

Respuesta :

Answer:

Written in Python:

def strings2(str1,str2):

    count = str1.count(str2)

    print("The count is:", count)

Explanation:

This line defines the function

def strings2(str1,str2):

The line counts the number occurrence of the substring (str2) in the main string (str1)

    count = str1.count(str2)

This line prints the number of occurence

    print("The count is:", count)