We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Capitalize!
You are viewing a single comment's thread. Return to all 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..