Files
30-seconds-of-code/snippets/capitalize_every_word.md
2019-10-08 02:43:58 +00:00

314 B

title, tags
title tags
capitalize_every_word string,beginner

Capitalizes the first letter of every word in a string.

Use s.title() to capitalize first letter of every word in the string.

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