How to code "How many vowels in this strings"
I'm a novice about Python. I tried to code "Count how many vowels in this strings" There is a way I can code, but it's so messy so I wanted to make it simple. Below is the problem that I have to solve. """ Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i', 'o', 'u' . For example, if s ='ffsdfddadxcxvxaaed', your program should print >>> Number of vowels: 4 So below is code that I coded. --------------------------------------------- s = 'dfsjknsckmlaaeiodkldmf' for i in s: vowels = 0 if i == 'a': vowels += 1 else: pass print(vowels) -------------------------------- When I run this, the result is 0. My question is, 1. why my coding result is 0? And what is wrong with my code? 2. How can I code simply about "How many vowels in this strings?" Thank you for making time and I hope you to have really great days!! :):):)