Skip to content

Commit

Permalink
Fix/fixes get top billionaries code (TheAlgorithms#11466)
Browse files Browse the repository at this point in the history
* fix: modify the depracated code and add new tests

* fix: remove test from pr

* fix: remove the useless utc import

* fix: add explicit tz argument

* fix: fixes ruff checking

* Remove UP017 #noqa comments from code

* Update get_top_billionaires.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update get_top_billionaires.py

---------

Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 16, 2024
1 parent af6a45e commit df94d46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web_programming/get_top_billionaires.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_forbes_real_time_billionaires() -> list[dict[str, int | str]]:
"Country": person["countryOfCitizenship"],
"Gender": person["gender"],
"Worth ($)": f"{person['finalWorth'] / 1000:.1f} Billion",
"Age": years_old(person["birthDate"]),
"Age": str(years_old(person["birthDate"] / 1000)),
}
for person in response_json["personList"]["personsLists"]
]
Expand Down Expand Up @@ -95,4 +95,7 @@ def display_billionaires(forbes_billionaires: list[dict[str, int | str]]) -> Non


if __name__ == "__main__":
from doctest import testmod

testmod()
display_billionaires(get_forbes_real_time_billionaires())

0 comments on commit df94d46

Please sign in to comment.