We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79c1941 commit bc3f902Copy full SHA for bc3f902
currency-converter.py
@@ -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