diff --git a/python-for-beginners/17 - JSON/create_json_from_dict.py b/python-for-beginners/17 - JSON/create_json_from_dict.py index 9f5d25b7..7484b559 100644 --- a/python-for-beginners/17 - JSON/create_json_from_dict.py +++ b/python-for-beginners/17 - JSON/create_json_from_dict.py @@ -6,7 +6,7 @@ person_dict['City']='Seattle' # Convert dictionary to JSON object -person_json = json.dumps(person_dict) +person_json = json.loads(person_dict) # Print JSON object -print(person_json) +print(json.dumps(person_json)) diff --git a/python-for-beginners/17 - JSON/create_json_with_list.py b/python-for-beginners/17 - JSON/create_json_with_list.py index 1a4cdb02..b9c62479 100644 --- a/python-for-beginners/17 - JSON/create_json_with_list.py +++ b/python-for-beginners/17 - JSON/create_json_with_list.py @@ -12,7 +12,7 @@ person_dict['languages']= languages_list # Convert dictionary to JSON object -person_json = json.dumps(person_dict) +person_json = json.loads(person_dict) # Print JSON object -print(person_json) \ No newline at end of file +print(json.dumps(person_json)) \ No newline at end of file diff --git a/python-for-beginners/17 - JSON/create_json_with_nested_dict.py b/python-for-beginners/17 - JSON/create_json_with_nested_dict.py index 8403354c..0a8e1681 100644 --- a/python-for-beginners/17 - JSON/create_json_with_nested_dict.py +++ b/python-for-beginners/17 - JSON/create_json_with_nested_dict.py @@ -10,7 +10,7 @@ staff_dict ={} staff_dict['Program Manager']=person_dict # Convert dictionary to JSON object -staff_json = json.dumps(staff_dict) +staff_json = json.loads(staff_dict) # Print JSON object -print(staff_json) \ No newline at end of file +print(json.dumps(staff_json)) \ No newline at end of file