s = input("Type a sentence: ") s1 = s.lower() total_a = 0 total_e = 0 total_i = 0 total_o = 0 total_u = 0 vowels = ["a", "e", "i", "o", "u"] for vowels in s1: if vowels == "a": total_a += 1 elif vowels == "e": total_e += 1 elif vowels == "i": total_i += 1 elif vowels == "o": total_o += 1 elif vowels == "u": total_u += 1 print("Number of a('s):" , total_a) print("Number of e('s):" , total_e) print("Number of i('s):" , total_i) print("Number of o('s):" , total_o) print("Number of u('s):" , total_u) total = total_a + total_e + total_i + total_o + total_u print("UWU. You have ", total, "vowels.")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question