I'm trying to teach myself Python and am doing some menial tasks with it. At the minute I'm working with lists and strings. I know that strings are immutable so I'm converting a string to a list and want to loop over the list to change any vowels to $ signs. The problem is that the $ sign isn't being attributed to the vowels. Here is my code:
aString = raw_input("Please enter a sentence: ")
aString = list(aString)
for i in xrange(len(aString)):
if i=='a' or \
i=='e' or \
i=='i' or \
i=='o' or \
i=='u':
i.newattribute = '$'
print aString