From a20d266382de9d901ce69ca1e888ec265051db58 Mon Sep 17 00:00:00 2001 From: spyguyrajat Date: Sun, 24 Oct 2021 21:16:06 +0530 Subject: [PATCH] json parsing --- Python/json parsing.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Python/json parsing.py diff --git a/Python/json parsing.py b/Python/json parsing.py new file mode 100644 index 00000000..68d3fc5e --- /dev/null +++ b/Python/json parsing.py @@ -0,0 +1,19 @@ +import json + +input = '''[ + { "id" : "001", + "x" : "2", + "name" : "Chuck" + }, + { "id" : "009", + "x" : "2", + "name" : "Duck" + } +]''' + +info = json.loads(input) + +print('User count:', len(info)) +print(info) +for item in info: + print(item) \ No newline at end of file