mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Fix/fixes get top billionaries code (#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 <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
af6a45e982
commit
df94d460ac
|
@ -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"]
|
||||
]
|
||||
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue
Block a user