Last active
September 12, 2022 12:46
-
-
Save narenaryan/271c9284ccf93d8603479234bfd5c8d9 to your computer and use it in GitHub Desktop.
Helper snippet for JSON article on medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| # JSON string | |
| foo = "[1, 2, 3]" | |
| # Decoded result | |
| result = json.loads(foo) | |
| print(result) # prints [1, 2, 3] | |
| print(type(result)) # prints <class 'list'> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment