There was an error while loading. Please reload this page.
1 parent 2218d84 commit 0511a82Copy full SHA for 0511a82
1 file changed
web_programming/crypto_price_tracker.py
@@ -24,7 +24,6 @@ def crypto_price(coin: str = "bitcoin") -> float:
24
url = f"https://api.coingecko.com/api/v3/simple/price?ids={coin}&vs_currencies=usd"
25
try:
26
json_response = httpx2.get(url, timeout=10).raise_for_status().json()
27
- return float(response.json().get(coin, {}).get("usd", 0.0))
28
except httpx2.RequestError, ValueError, KeyError:
29
return 0.0
30
return float(json_response.get(coin, {}).get("usd", 0.0))
0 commit comments