I have solved the problem of how to capitalize the first and forth letter but out of curiosity I am trying to do that for all the words in a list rather than just the first:
def my_function(name):
if len(name) > 3:
return name[:3].capitalize() + name[3:].capitalize()
else:
return 'Name is too short'
result = my_function('oldmac')
print(result)