-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject_card.py
More file actions
65 lines (56 loc) · 1.27 KB
/
Copy pathproject_card.py
File metadata and controls
65 lines (56 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
''' 1 usd = 86.448 rupee'''
currencies = {
"INR":1,
"USD":86.448,
"EUR":91.63488,
"YEN":0.5792061,
"GBP":106.33104,
"AUD":55.32672,
"CAD":63.97152,
}
def to_inr():
cur = input("")
amt = int(input())
if(cur == "USD"):
rate = 86.448
elif(cur == "INR"):
rate = (amt)
elif(cur == "EUR"):
rate = 91.63488
elif(cur == "YEN"):
rate =0.5792061
elif(cur == "GBP"):
rate = 106.33104
elif(cur == "AUD"):
rate = 55.32672
elif(cur == "CAD"):
rate = 63.97152
else:
raise Exception(f"{cur} is not supported")
if (amt<0):
return ("Invalid input")
return amt*rate
def to_inr():
cur = input("")
amt = int(input())
if(cur == "USD"):
rate = 0.0115676
elif(cur == "INR"):
rate = 1
elif(cur == "EUR"):
rate = 0.01091287
elif(cur == "YEN"):
rate =1.726501153
elif(cur == "GBP"):
rate = 0.009404591
elif(cur == "AUD"):
rate = 0.018074449
elif(cur == "CAD"):
rate = 0.015631956
else:
raise Exception(f"{cur} is not supported")
if (amt<0):
return ("Invalid input")
return round(amt*rate,4)
change = to_inr()
print(change)