Skip to content

Instantly share code, notes, and snippets.

@serrasqueiro
Last active April 11, 2026 10:45
Show Gist options
  • Select an option

  • Save serrasqueiro/9c14acdc50315307e875955e15192abe to your computer and use it in GitHub Desktop.

Select an option

Save serrasqueiro/9c14acdc50315307e875955e15192abe to your computer and use it in GitHub Desktop.
Dictionary for Title case
# Install the library first:
# pip install titlecase
from titlecase import titlecase
def format_title(text: str) -> str:
return titlecase(text)
if __name__ == "__main__":
raw = "lifetime of surprises"
formatted = format_title(raw)
print("Original:", raw)
print("Title‑cased:", formatted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment