Skip to content

Correct the misuse of json.dumps() #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python-for-beginners/17 - JSON/create_json_from_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
4 changes: 2 additions & 2 deletions python-for-beginners/17 - JSON/create_json_with_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
print(json.dumps(person_json))
Original file line number Diff line number Diff line change
Expand Up @@ -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)
print(json.dumps(staff_json))