Capitalize!

  • + 0 comments

    thats the thing i have come with. things to know for this - split(' ') - we are just dividing with a white space , islpha() - it will check the word is alphabet or not

    def solve(s):
        m = s.split(' ')
    
        new =[]
        for i in range(len(m)):
            if m[i].isalpha():
                new.append(m[i].capitalize())
            else:
                new.append(m[i])
        final = " ".join(new)
        return final**