PyDocs

Nav

Python Runtime Services

str.capitalize

builtins

method of str
  • str.capitalize()
Return a capitalized version of the string.

More specifically, make the first character have upper case and the
rest lower case.
Changed in 3.8
  • 3.8: The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first letter capitalized, instead of the full character.
0 Examples
No examples for builtins/str.capitalize.
See Also
No see-alsos for builtins/str.capitalize
0 Notes
No notes for str.capitalize