Capitalizing First Letters of Words in Text

  • Share this:

Code introduction


This function capitalizes the first letter of each word in the input text.


Technology Stack : String splitting, list comprehension, string capitalize

Code Type : String processing

Code Difficulty : Intermediate


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