Python #8 : Capitalize!
Welcome all to our new blog of our first series i.e., HackerRank Python Solutions, where we provide solutions to the problems given on HackerRank Website of Python.
So, today we are going to see the problem of capitalise in the Python section of HackerRank Website.
Here we have to capitalise the starting character of every single word it gives as a sample we are dealing with good example and here we will use this code given below for fertilizing the first letter of each word.
def solve(s): for x in s[:].split(): s = s.replace(x, x.capitalize()) return s So here we can see we capitalize every word by just using this function, If you wanna understand more, you should learn about the split function that is used in this function.
Till Then, #Coders😎
Recent Posts
See AllMy last blogg about gaming from your android, or my other blogs, that I published earlier were not a big hit, not like this website or...
Comments