mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Remove mention of backquotes in the tutorial.
This commit is contained in:
parent
463f39d9ac
commit
b04d4853a7
1 changed files with 1 additions and 6 deletions
|
|
@ -31,9 +31,7 @@ way is to use the :meth:`str.format` method.
|
||||||
|
|
||||||
One question remains, of course: how do you convert values to strings? Luckily,
|
One question remains, of course: how do you convert values to strings? Luckily,
|
||||||
Python has ways to convert any value to a string: pass it to the :func:`repr`
|
Python has ways to convert any value to a string: pass it to the :func:`repr`
|
||||||
or :func:`str` functions. Reverse quotes (``````) are equivalent to
|
or :func:`str` functions.
|
||||||
:func:`repr`, but they are no longer used in modern Python code and are removed
|
|
||||||
in future versions of the language.
|
|
||||||
|
|
||||||
The :func:`str` function is meant to return representations of values which are
|
The :func:`str` function is meant to return representations of values which are
|
||||||
fairly human-readable, while :func:`repr` is meant to generate representations
|
fairly human-readable, while :func:`repr` is meant to generate representations
|
||||||
|
|
@ -68,9 +66,6 @@ Some examples::
|
||||||
>>> # The argument to repr() may be any Python object:
|
>>> # The argument to repr() may be any Python object:
|
||||||
... repr((x, y, ('spam', 'eggs')))
|
... repr((x, y, ('spam', 'eggs')))
|
||||||
"(32.5, 40000, ('spam', 'eggs'))"
|
"(32.5, 40000, ('spam', 'eggs'))"
|
||||||
>>> # reverse quotes are convenient in interactive sessions:
|
|
||||||
... `x, y, ('spam', 'eggs')`
|
|
||||||
"(32.5, 40000, ('spam', 'eggs'))"
|
|
||||||
|
|
||||||
Here are two ways to write a table of squares and cubes::
|
Here are two ways to write a table of squares and cubes::
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue