Hey guys! I wrote a small program, which works. Unfortunately, when things get too complicated, it breaks down.
The objective is to list the occurrences of vowels in a given word, such that for (word = yellow) and index spits out (e = 1, o = 1)
The code KIND OF does it, but seems to reiterate its objective. Can someone take a look and tell me what I did wrong?
def duplicount():
import string
word = raw_input('Please enter your word:')
vowels = ['a','e','i','o','u']
count = {}
for index,letters in enumerate(word):
if letters in vowels:
count[letters] = index
print count
duplicount()
Yes, I searched google. Yes, I searched the forums.
:wub: