mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 15:01:08 +00:00
Refactor currency_converter.py (#5917)
* Update currency_converter.py * refactor: add types and remove reserved keyword "from" usage * feat: update text * Update web_programming/currency_converter.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * Update web_programming/currency_converter.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * fix: update currency_converter.py * updating DIRECTORY.md * Update currency_converter.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
7423875cef
commit
c15a4d5af6
|
@ -10,9 +10,11 @@ import requests
|
|||
URL_BASE = "https://www.amdoren.com/api/currency.php"
|
||||
TESTING = os.getenv("CI", False)
|
||||
API_KEY = os.getenv("AMDOREN_API_KEY", "")
|
||||
if not API_KEY and not TESTING:
|
||||
raise KeyError("Please put your API key in an environment variable.")
|
||||
|
||||
if not API_KEY and not TESTING:
|
||||
raise KeyError(
|
||||
"API key must be provided in the 'AMDOREN_API_KEY' environment variable."
|
||||
)
|
||||
|
||||
# Currency and their description
|
||||
list_of_currencies = """
|
||||
|
|
Loading…
Reference in New Issue
Block a user