Capitalize!

  • + 0 comments

    Yes, I also commented on this but no one is replying. I dont know why. Any substring that present in another substring will also get capitalise. Why are they not understanding this..... if u put "a" in a sentence like--- "I am a good boy from asia." It will produce -- I Am A good boy from AsiA. meanwhile I developed a code that is way basic and works in every scene..

    • def solve(s):

    • x=len(s)

    • news=""+s[0].upper()

    • for i in range(1,x):

    • if(s[i-1]==" " and s[i]!=' '):

    • news= news + s[i].upper()

    • else:

    • news= news + s[i]

    • return news