Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 303 Bytes

capitalize-words.md

File metadata and controls

14 lines (12 loc) · 303 Bytes
title description author tags
Capitalize Words
Capitalizes the first letter of each word in a string.
axorax
string,capitalize
def capitalize_words(s):
    return ' '.join(word.capitalize() for word in s.split())

# Usage:
capitalize_words('hello world') # Returns: 'Hello World'