Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/JSON/Python/json-1.py
Normal file
10
Task/JSON/Python/json-1.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
>>> import json
|
||||
>>> data = json.loads('{ "foo": 1, "bar": [10, "apples"] }')
|
||||
>>> sample = { "blue": [1,2], "ocean": "water" }
|
||||
>>> json_string = json.dumps(sample)
|
||||
>>> json_string
|
||||
'{"blue": [1, 2], "ocean": "water"}'
|
||||
>>> sample
|
||||
{'blue': [1, 2], 'ocean': 'water'}
|
||||
>>> data
|
||||
{'foo': 1, 'bar': [10, 'apples']}
|
||||
4
Task/JSON/Python/json-2.py
Normal file
4
Task/JSON/Python/json-2.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
>>> true = True; false = False; null = None
|
||||
>>> data = eval('{ "foo": 1, "bar": [10, "apples"] }')
|
||||
>>> data
|
||||
{'foo': 1, 'bar': [10, 'apples']}
|
||||
Loading…
Add table
Add a link
Reference in a new issue