Q. Write a user defined function to convert a string with more than one word into title case string where string is passed as parameter.  (Title case means that the first letter of each word is capitalised)


Answer :-


def pathwalla( line ) :
    newline = ""
    word = line.split( )
    for i in word :
        newline +=  " " + i.capitalize()
    return newline[ 1 : ]

s = input("Input a line :- ")
print( pathwalla(s) )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post