Last active
April 11, 2026 10:45
-
-
Save serrasqueiro/9c14acdc50315307e875955e15192abe to your computer and use it in GitHub Desktop.
Dictionary for Title case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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