Capitalize!

  • + 1 comment

    hi. i know that i made things complicated but can you tell me why i fail some of the test cases (4/6), with this code?

    import string alphabet_list = list(string.ascii_lowercase) def solve(s): list1 = s.split() answer = [] for each in list1: if each[0] in alphabet_list: answer.append(each.title()) else: answer.append(each) final = " ".join(answer) return final