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

Google Code-In mentorship experience :)

Hacker Rank all java and python problem solutions