OLD MACDONALD: Write a function that capitalizes the first and fourth letters of a name
I'm trying to write this in different ways and I also feel like there's an easier way to do this. Cant, you directly apply it without getting all the other words of a string? Or a split or something?
Here is one of my attempts at trying it another way. I'm trying to do it with a for AND an if statement too. Any help is appreciated.
def old_macdonald(words): wordletter = words[0] fourthletter = words[3] newword = [] for i,l in enumerate(words): if i[0]: newword = l.capatalize return newword if i[3]: newword = l.capatalize return newword