+ 2
No action in a course
Hi, I've been stuck in Python Data Structures at 3.2 Practice, "How Many Vowels?". I've done it well but no action. What happens?
7 Réponses
+ 2
Yes, of course.
This is the code
vowels = set('aeiouAEIOU')
counter_vowels = []
text = 'python is great, its awesome!'
for i in text:
if i in vowels:
counter_vowels.append(i)
print(len(counter_vowels))
+ 2
Thanks, mate!
+ 1
Did you print the count of vowels at the end?
+ 1
You have to take the string as input and count the number of vowels. The variable 'text' should be input.
+ 1
Change line 3:
text = input()
This is the only error
+ 1
str = input()
count = 0
for c in str :
if(c=='a' or c=='e' or c=='i' or c=='o' or c=='u' or c=='A' or c=='E' or c=='I' or c=='O' or c=='U'):
count += 1
print(count)
0
Здравствуйте