hacker rank python(Capitalize!)solution

CAPITALIZE!



# Complete the solve function below.
def solve(s):
    str= [i.strip().capitalize() for i in s.split() ]
    for i in str:
         s =s.replace(i.lower(),i)
    return s

Compiler Message
Success
Input (stdin)Download
hello world
Expected OutputDownload
Hello World


Comments

Popular posts from this blog

Amazon Web Services

Hacker Rank all java and python problem solutions

Testing tools for React Apps