Capitalizing First Letters in Sentences

  • Share this:

Code introduction


Capitalize the first letter of each word in the input sentence.


Technology Stack : str.split(), str.capitalize()

Code Type : String processing

Code Difficulty : Intermediate


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