Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Jan 9, 2024
1 parent f7b1cf7 commit 8f5262f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lessons/beginners-en/json/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ sampleJson = """{
content = json.loads(sampleJson)
employees = content.get("company", {}).get("employees", [])
for employee in employees:
if employee.get("name", "") == "emma":
break
payable = employee.get("payable", {})
total = payable.get("salary", 0) + payable.get("bonus", 0)
print(f"Anna has a total salary with bonus: {total}")
name = employee.get('name')
if name == "emma":
payable = employee.get("payable", {})
total = payable.get("salary", 0) + payable.get("bonus", 0)
print(f"{name} has a total salary with bonus: {total}")
```
{% endfilter %}

Expand Down

0 comments on commit 8f5262f

Please sign in to comment.