Skip to content

Commit 4b36cec

Browse files
authored
Python Deserialize JSON String to Object
Python Deserialize JSON String to Object
1 parent 50a9fa2 commit 4b36cec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

deserialize_json_string.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import json
2+
3+
json_data = '{"firstName": "Larry", "lastName":"Scott", "email": "larry@toricode.com"}'
4+
5+
json_object = json.loads(json_data)
6+
7+
print("Object type: ", type(json_object))
8+
print("First Name: ", json_object['firstName'])
9+
print("Last Name: ", json_object['lastName'])
10+
print("Email Address: ", json_object['email'])

0 commit comments

Comments
 (0)