Capitalizing First Letter of Words

  • Share this:

Code introduction


This function capitalizes the first letter of each word in the input sentence while keeping the rest in lowercase.


Technology Stack : String manipulation

Code Type : String Handling Function

Code Difficulty : Intermediate


                
                    
def capitalize_first_letter_of_words(sentence):
    return ' '.join(word.capitalize() for word in sentence.split())