# Program 5: String Analyzer # Known Bugs (may have others): # 1. Vowel count is wrong # 2. Average word length is wrong def analyze_string(text): """Analyze a string for vowels and word lengths.""" vowels = ['a', 'e', 'i', 'o', 'u'] vowel_count = 0 words = text.split() for char in text: if char in vowels: vowel_count += 1 total_length = 0 for word in words: total_length += 1 avg_word_length = total_length / len(words) return { 'vowels': vowel_count, 'average_word_length': avg_word_length } sample_text = "Python Programming Is Fun" result = analyze_string(sample_text) print("Analysis:", result)