Skip to content

Commit bc3f902

Browse files
authored
Add files via upload
adding a new file
1 parent 79c1941 commit bc3f902

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

currency-converter.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rates = {
2+
"USD": 1.0,
3+
"INR": 83.5,
4+
"EUR": 0.91,
5+
"GBP": 0.78,
6+
"JPY": 143.2
7+
}
8+
9+
amount = float(input("Enter amount: "))
10+
from_currency = input("From (USD/INR/EUR/GBP/JPY): ").upper()
11+
to_currency = input("To (USD/INR/EUR/GBP/JPY): ").upper()
12+
13+
converted = amount / rates[from_currency] * rates[to_currency]
14+
15+
print(f"{amount} {from_currency} = {round(converted, 2)} {to_currency}")

0 commit comments

Comments
 (0)