This is some code I have made to count the most occuring vowels within the inputted message. Everytime I run it, it prints out it out 5 times, how can I fix this?
I also want it to display a message when there is no vowel entered. Maybe someone can point me in the right direction?
msg = input("Enter a sentence: ") v = set(['a', 'e', 'i', 'o', 'u']) a = dict() for letter in v: a[letter] = msg.count(letter) for letter in a: m = max([ (a[v],v) for v in a]) print("Most occuring vowel is", m)