Skip to content
This repository was archived by the owner on May 7, 2023. It is now read-only.

Files

Latest commit

 

History

History
20 lines (16 loc) · 394 Bytes

capitalize-every-word.md

File metadata and controls

20 lines (16 loc) · 394 Bytes
title type tags cover dateModified
Capitalize every word
snippet
string
trippy-chemicals
2020-11-02 19:27:07 +0200

Capitalizes the first letter of every word in a string.

  • Use str.title() to capitalize the first letter of every word in the string.
def capitalize_every_word(s):
  return s.title()
capitalize_every_word('hello world!') # 'Hello World!'