Skip to content

Commit df94d46

Browse files
ra230537cclausspre-commit-ci[bot]
authored
Fix/fixes get top billionaries code (TheAlgorithms#11466)
* 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>
1 parent af6a45e commit df94d46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web_programming/get_top_billionaires.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_forbes_real_time_billionaires() -> list[dict[str, int | str]]:
6565
"Country": person["countryOfCitizenship"],
6666
"Gender": person["gender"],
6767
"Worth ($)": f"{person['finalWorth'] / 1000:.1f} Billion",
68-
"Age": years_old(person["birthDate"]),
68+
"Age": str(years_old(person["birthDate"] / 1000)),
6969
}
7070
for person in response_json["personList"]["personsLists"]
7171
]
@@ -95,4 +95,7 @@ def display_billionaires(forbes_billionaires: list[dict[str, int | str]]) -> Non
9595

9696

9797
if __name__ == "__main__":
98+
from doctest import testmod
99+
100+
testmod()
98101
display_billionaires(get_forbes_real_time_billionaires())

0 commit comments

Comments
 (0)