Capitalize!

  • + 0 comments

    def solve(s): result = [] for i in s.split(): result.append(i.capitalize()) return ' '.join(result)

    • s.split will splt the first and last name
    • for loop will iterate over each word from s capitalize it and append to result
    • .join will create a string from alist