diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 3486a18b5cb1f0..30943b64fd1c0a 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1759,7 +1759,14 @@ expression support in the :mod:`re` module). .. method:: str.capitalize() Return a copy of the string with its first character capitalized and the - rest lowercased. + rest lowercased. For example:: + + >>> 'PYTHON IS AMAZING'.capitalize() + 'Python is amazing' + >>> 'LJjubljana starts With a non-english digraph'.capitalize() + 'Ljjubljana starts with a non-english digraph' + + See also :meth:`title`. .. versionchanged:: 3.8 The first character is now put into titlecase rather than uppercase.