diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 3486a18b5cb1f0..3d3a7267cba560 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' + >>> 'Njemačka starts With a non-ASCII digraph'.capitalize() + 'Njemačka starts with a non-ascii digraph' + + See also :meth:`title`. .. versionchanged:: 3.8 The first character is now put into titlecase rather than uppercase.