str.capitalize() vs str.title()
str.capitalize() and str.title() are both Python String Methods APIs, and choosing between them is a common point of confusion. This page compares their syntax, parameters, return values, and typical use cases so you can pick the right one. str.capitalize(): Returns a copy with the first character capitalized and the rest lowercased. Its syntax is str.capitalize(), and it returns capitalized string str.title(): Returns a titlecased version where each word starts with uppercase. Its syntax is str.title(), and it returns titlecased string Example of str.capitalize(): "hello WORLD".capitalize() # "Hello world". Example of str.title(): "hello world".title() # "Hello World". Read the full references for str.capitalize() and str.title() to see parameters, edge cases, and example code side by side. Other String Methods APIs worth comparing: str.upper(), str.lower(), str.strip(), str.lstrip(), str.rstrip(), str.split(). Both belong to the String Methods category in the Python Reference documentation. Try both in the Python playground to see the behavioral difference live.