Having a slight problem with this function in Python that's supposed to return the first letter of every word in a string capitalized and everything else lowercased:
def titleize(phrase):
split_phrase = phrase.split()
for word in split_phrase:
word.capitalize()
return ' '.join(split_phrase)
titleize('oNLy cAPITALIZe fIRSt')
-> oNLy cAPITALIZe fIRSt
Clearly the issue is with the loop over the phrase (I think) that is being split and I suspect it's not mutating but rather creating something new but I'm stuck trying to fix it.