Files
30-seconds-of-code/snippets/capitalize_every_word.md
2019-08-20 10:09:53 +03:00

317 B

title, tags
title tags
capitalize_every_word string

Capitalizes the first letter of every word in a string.

Uses str.title to capitalize first letter of every word in the string.

def capitalize_every_word(string):
    return string.title()
capitalize_every_word('hello world!') # 'Hello World!'