I am a beginner, and I am trying to find out the number of vowels in each word in a string. So for instance, if I had "Hello there WORLD"
, I want to get an output of [2, 2, 1]
.
Oh, and I am using Python.
I have this so far
[S.count(x) in (S.split()) if x is 'AEIOUaeiou']
where S="Hello there WORLD"
but it keeps saying error. Any hints?