From 4b36cec7eb19fccbebb16485186ce2b02d20835b Mon Sep 17 00:00:00 2001 From: toricode <59090883+toricode@users.noreply.github.com> Date: Mon, 23 Dec 2019 21:51:45 +0700 Subject: [PATCH] Python Deserialize JSON String to Object Python Deserialize JSON String to Object --- deserialize_json_string.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 deserialize_json_string.py diff --git a/deserialize_json_string.py b/deserialize_json_string.py new file mode 100644 index 0000000..d86d428 --- /dev/null +++ b/deserialize_json_string.py @@ -0,0 +1,10 @@ +import json + +json_data = '{"firstName": "Larry", "lastName":"Scott", "email": "larry@toricode.com"}' + +json_object = json.loads(json_data) + +print("Object type: ", type(json_object)) +print("First Name: ", json_object['firstName']) +print("Last Name: ", json_object['lastName']) +print("Email Address: ", json_object['email'])