I am trying to solve this problem below
Assume s is a string of lower case characters. Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i', 'o', and 'u'. For example, if s = 'azcbobobegghakl', your program should print:
Number of vowels: 5
I wrote the following code
s='azcbobobegghakl'
count = 0
for vowels in s:
if vowels in 'aeiou':
count += 1
print ('Number of vowels: ' + str(count))
This was not correct. I learned that you should not define "azcbobobegghakl" as s or g or anything else for that matter. Do I need to use a certain function to accomplish this?
for vowels in 'azcbobobegghakl'?