-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
62 lines (51 loc) · 1.74 KB
/
main.py
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
gbp = 0.77
usd = 1.30
euro = 1.10
yen = 137.18
def menu():
print("Currency Converter \n")
print("Select an option to convert \n")
print("1) GBP to USD")
print("2) USD to GBP")
print("3) EURO to GBP")
print("4) GBP to EURO")
print("5) YEN to GBP")
print("6) GBP to YEN")
print("7) Exit")
option = int(input("Type the number of the conversion you want to use: "))
if option == 1:
cGBP = int(input("Please enter the amount you want to convert: "))
print('{} GBP is {} USD\n'.format(cGBP, cGBP*usd))
menu()
elif option == 2:
cUSD = int(input("Please enter the amount you want to convert: "))
conversion = cUSD * gbp
fee = conversion * 0.125
print('{} USD is {} GBP\n'.format(cUSD, conversion - fee))
menu()
elif option == 3:
cEURO = int(input("Please enter the amount you want to convert: "))
conversion = cEURO * gbp
fee = conversion * 0.125
print('{} EURO is {} GBP\n'.format(cEURO, conversion - fee))
menu()
elif option == 4:
cGBP = int(input("Please enter the amount you want to convert: "))
print('{} GBP is {} EURO\n'.format(cGBP, cGBP*euro))
menu()
elif option == 5:
cYEN = int(input("Please enter the amount you want to convert: "))
conversion = cYEN * gbp
fee = conversion * 0.125
print('{} YEN is {} GBP\n'.format(cYEN, conversion - fee))
menu()
elif option == 6:
cGBP = int(input("Please enter the amount you want to convert: "))
print('{} GBP is {} YEN\n'.format(cGBP, cGBP*yen))
menu()
elif option == 7:
exit()
else:
print("Choose a valid number")
menu()
menu()