Advertisement
simeonshopov

Currency converter

Sep 11th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. value=float(input())
  2. currency1=input()
  3. currency2=input()
  4.  
  5. if currency1=="BGN":
  6.   if currency2=="USD":
  7.     exit=value/1.79549
  8.     print(f"{exit:.2f} USD")
  9.   elif currency2=="EUR":
  10.     exit=value/1.95583
  11.     print(f"{exit:.2f} EUR")
  12.   elif currency2=="GBP":
  13.     exit=value/2.53405
  14.     print(f"{exit:.2f} GBP")
  15.    
  16. if currency1=="USD":
  17.   if currency2=="BGN":
  18.     exit=value*1.79549
  19.     print(f"{exit:.2f} BGN")
  20.   elif currency2=="EUR":
  21.     exit=(value*1.79549)/1.95583
  22.     print(f"{exit:.2f} EUR")
  23.   elif currency2=="GBP":
  24.     exit=(value*1.79549)/2.53405
  25.     print(f"{exit:.2f} GBP")
  26.    
  27. if currency1=="EUR":
  28.   if currency2=="BGN":
  29.     exit=value*1.95583
  30.     print(f"{exit:.2f} BGN")
  31.   elif currency2=="USD":
  32.     exit=(value*1.95583)/1.79549
  33.     print(f"{exit:.2f} USD")
  34.   elif currency2=="GBP":
  35.     exit=(value*1.95583)/2.53405
  36.     print(f"{exit:.2f} GBP")
  37.    
  38. if currency1=="GBP":
  39.   if currency2=="BGN":
  40.     exit=value*2.53405
  41.     print(f"{exit:.2f} BGN")
  42.   elif currency2=="USD":
  43.     exit=(value*2.53405)/1.79549
  44.     print(f"{exit:.2f} USD")
  45.   elif currency2=="EUR":
  46.     exit=(value*2.53405)/1.95583
  47.     print(f"{exit:.2f} EUR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement