def has_more_vowel(a_string, c_count, v_count): '''("str, int, int) -> int This recursive function determines if a given string has more vowels than consonants. c_count represent the number of consonant in a_string v_count represent the number of vowels in a_string''' if (len(a_string) ==0): return (v_count > c_count) vowels = ['a', 'e','i','o','u', 'A', 'E', 'I', 'O', 'U'] if (a_string[0] in vowels): v_count += 1 else: c_count += 1 return has_more_vowel(a_string[1:], c_count, v_count) def vowel_count(a_string, v_count): '''("str) -> int This recursive function returns the number of vowels in a_string. v_count represent the number of vowels in a_string''' if (len(a_string) ==0): return v_count vowels = ['a', 'e','i','o','u', 'A', 'E', 'I', 'O', 'U'] if (a_string[0] in vowels): v_count +=1 return vowel_count(a_string[1:], v_count) def letter_count(a_string, c_count, v_count): '''("str, int, int) -> int This recursive function returns the number of consonant and vowels in a_string. c_count represent the number of consonant in a_string v_count represent the number of vowels in a_string''' if (len(a_string) ==0): return (c_count, v_count) vowels = ['a', 'e','i','o','u', 'A', 'E', 'I', 'O', 'U'] if (a_string[0] in vowels): v_count += 1 else: c_count += 1 return letter_count(a_string[1:], c_count, v_count) print(has_more_vowel("TrAin", 0, 0)) print(has_more_vowel("Trainee", 0, 0)) print(vowel_count("Train", 0)) print(vowel_count("TrainEe", 0)) print(letter_count("Train", 0,0)) print(letter_count("Trainee", 0,0))