mirror of
https://github.com/python/cpython.git
synced 2025-09-29 11:45:57 +00:00
bpo-30621: Update Input Output Tutorial Example(GH-2074) (GH-2118)
import json before using json module
(cherry picked from commit 1dbce04d0e
)
This commit is contained in:
parent
2737291134
commit
47c9decb5f
1 changed files with 1 additions and 0 deletions
|
@ -412,6 +412,7 @@ sent over a network connection to some distant machine.
|
||||||
If you have an object ``x``, you can view its JSON string representation with a
|
If you have an object ``x``, you can view its JSON string representation with a
|
||||||
simple line of code::
|
simple line of code::
|
||||||
|
|
||||||
|
>>> import json
|
||||||
>>> json.dumps([1, 'simple', 'list'])
|
>>> json.dumps([1, 'simple', 'list'])
|
||||||
'[1, "simple", "list"]'
|
'[1, "simple", "list"]'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue