-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask2.py
More file actions
44 lines (35 loc) · 1.54 KB
/
Copy pathtask2.py
File metadata and controls
44 lines (35 loc) · 1.54 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
'''
•Write a program that converts €, $ and £ into one another.
•The program should ask the user to choose the currency to convert from,
and the currency to convert into, then should ask for the amount to convert,
and return the result of the conversion onto the screen.
'''
while True:
From_Currency = input("choose the currency to convert from: you can choose '€' '£' '$'")
Into_Currency = input("currency to convert into: you can choose '€' '£' '$'")
Amount = float(input("chose the amount of currency to convert from"))
if From_Currency == "€" and Into_Currency == "$":
print('the amount of currency converted into is')
print(Amount*1.15)
elif From_Currency == "€"and Into_Currency == "£":
print('the amount of currency converted into is')
print(Amount*0.89)
elif From_Currency == "£" and Into_Currency == "€":
print('the amount of currency converted into is')
print(Amount*1.13)
elif From_Currency == "£"and Into_Currency == "$":
print('the amount of currency converted into is')
print(Amount*1.30)
elif From_Currency == "$"and Into_Currency == "€":
print('the amount of currency converted into is')
print(Amount*0.87)
elif From_Currency == "$"and Into_Currency == "£":
print('the amount of currency converted into is')
print(Amount*0.77)
else:
print("please do it again")
Continue = input("\n\nDo you want to continue?.'yes'or'no'")
if Continue =="yes":
continue
else:
break