Python Capitalize First Letter of each word || Python
In this we are going to see a basic program of capitalize first letter of each word in Python Programming Language.



# Note: this does not apply to words starting with numbers

def Capitalize(s):
    for w in s.split():
        s = s.replace(w, w.capitalize())
    return s

def main():
    s = input("Enter name: ")
    result = Capitalize(s)
    print(result)

main()

# Coded by Shreya Idate


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post