Skip to content

Commit 47cb760

Browse files
committed
currency converter
1 parent 87533ed commit 47cb760

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

web_programming/currency_converter.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
2-
This is used to convert the currency from one currency to another using the Amdoren Currency API
2+
This is used to convert the currency using the Amdoren Currency API
33
"""
44

55
import requests
66

7-
# API_KEY = "" # <-- Put your API Key here
8-
API_KEY = "frSPXKMN93QNsmyQSjTcA4E26z6ryP"
7+
API_KEY = "" # <-- Put your API Key here
98
URL_BASE = "https://www.amdoren.com/api/currency.php"
109

11-
# If you are using it on a website and free api key please add the below line in your website
10+
# If you are using it on a website and free api key please add the below
11+
# line in your website
1212
# Powered by <a href="https://www.amdoren.com">Amdoren</a>
1313

1414

@@ -178,7 +178,8 @@ def convert_currency(
178178
) -> str:
179179
"""https://www.amdoren.com/currency-api/"""
180180
res = requests.get(
181-
f"{URL_BASE}?api_key={API_KEY}&from={baseCurrency}&to={targetCurrency}&amount={amount}"
181+
f"{URL_BASE}?api_key={API_KEY}&from={baseCurrency}&to={targetCurrency}&\
182+
amount={amount}"
182183
).json()
183184
if res["error"] == 0:
184185
return str(res["amount"])

0 commit comments

Comments
 (0)