Skip to content

Commit a23097c

Browse files
Create crypto_price.py
Added a simplest way to convert ETH into USD
1 parent a71618f commit a23097c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

crypto_price.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Let's assume 1 ETH = 2500 USD (you can change this number)
2+
eth_price_usd = 2500
3+
4+
print("=== ETH to USD Converter ===")
5+
6+
# Ask user for ETH amount
7+
eth_amount = float(input("Enter amount of ETH: "))
8+
9+
# Convert to USD
10+
usd_value = eth_amount * eth_price_usd
11+
12+
# Show result
13+
print(f"{eth_amount} ETH = ${usd_value} USD")

0 commit comments

Comments
 (0)