Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. amount   = float(input())
  2. cur_from = str(input())
  3. cur_to   = str(input())
  4.  
  5. bgn_c = 1
  6. usd_c = 1.79549
  7. eur_c = 1.95583
  8. gbp_c = 2.53405
  9.  
  10. if cur_from == 'USD':
  11.     amount *= usd_c
  12.     if cur_to == 'GBP':
  13.         print(round(amount / gbp_c , 2), 'GBP')
  14.     if cur_to == 'EUR':
  15.         print(round(amount / eur_c , 2), 'EUR')
  16.     if cur_to == 'BGN':
  17.         print(round(amount / bgn_c , 2), 'BGN')
  18. elif cur_from == 'BGN':
  19.     amount *= bgn_c
  20.     if cur_to == 'GBP':
  21.         print(round(amount / gbp_c , 2), 'GBP')
  22.     if cur_to == 'EUR':
  23.         print(round(amount / eur_c , 2), 'EUR')
  24.     if cur_to == 'USD':
  25.         print(round(amount / usd_c , 2), 'USD')
  26. elif cur_from == 'GBP':
  27.     amount *= gbp_c
  28.     if cur_to == 'BGN':
  29.         print(round(amount / bgn_c , 2), 'BGN')
  30.     if cur_to == 'EUR':
  31.         print(round(amount / eur_c , 2), 'EUR')
  32.     if cur_to == 'USD':
  33.         print(round(amount / usd_c , 2), 'USD')
  34. elif cur_from == 'EUR':
  35.     amount *= eur_c
  36.     if cur_to == 'BGN':
  37.         print(round(amount / bgn_c , 2), 'BGN')
  38.     if cur_to == 'GBP':
  39.         print(round(amount / gbp_c , 2), 'GBP')
  40.     if cur_to == 'USD':
  41.         print(round(amount / usd_c , 2), 'USD')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement