""" Write a function count_cm that takes one parameter, a string of characters, and returns the number of characters between c and m and the number of characters between C and M. Pay attention: THE FUNCTION RETURNS TWO COUNTERS. For example, if the string is CatDogcAlm the function returns: 4,2 Write a program that reads 5 strings, and for each string prints the number of chars between 'c' and 'm' (inclusive), and the number of chars between 'C' and 'M' (inclusive). In addition, the program finds the average number of chars in each category. """ def count_cm(str): count_cm=0 count_CM=0 for item in str: if(item>='c' and item<='m'): count_cm+=1 elif(item>='C' and item<='M'): count_CM+=1 return count_cm, count_CM def main(): sum_cm=0 sum_CM=0 for i in range(5): str=input("enter str ") c1, c2=count_cm(str) print(str,"has",c1,"between c and m and",c2,"between C and M") sum_cm+=c1 sum_CM+=c2 print("average in each category", sum_cm/5, sum_CM/5) main()