sentence = input("input 200 characters if you want: ") lower_case = sentence.lower() array = list(lower_case) total_a = 0 total_e = 0 total_i = 0 total_o = 0 total_u = 0 for character in array: if character == 'a': total_a += 1 elif character == 'e': total_e += 1 elif character == 'i': total_i += 1 elif character == 'o': total_o += 1 elif character == 'u': total_u += 1 print ("Total occurrences of a: " , total_a) print ("Total occurrences of e: " , total_e) print ("Total occurrences of i: " , total_i) print ("Total occurrences of o: " , total_o) print ("Total occurrences of u: " , total_u)
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