+ 1
How to fix this i feel something off
vowels = "aeiouAEIOU" word = input() for letters in word: if letters in vowels: print() Why its not working probably
3 Antwoorden
+ 3
Are you trying to count the letters that are vowels or are you trying to only print the vowels found ?
I believe you are missing the idea that you want to count how many vowels were found ? But i could be mistaken.
https://www.sololearn.com/coach/80?ref=app
+ 2
Hamza Saber
you should have a count variable that gets incremented when the letter is a vowel.
maybe something like this:
vowels = "aeiouAEIOU"
word = input()
count = 0 # add this
for letters in word:
if letters in vowels:
count += 1 # do this
print(count) # what you want
a more advanced method is:
print(sum([1 for x in input() if x in 'aeiouAEIOU']))
it would be a good learning journey to try and figure out how this one-liner works. 🧐
0
Idk what to add in print i tried adding letters but it just dont tell how much it give me the letters