Advertisement
Guest User

Untitled

a guest
Jun 7th, 2024
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. USD_TO_BGN_EXCCHANGE_RATE = 1.79549
  2. EUR_TO_BGN_EXCHANGE_RATE = 1.95583
  3. GBP_TO_BGN_EXCHANGE_RATE = 2.53405
  4.  
  5. current_currency = float(input())
  6. string_1 = input()
  7. string_2 = input()
  8.  
  9. bgnValue = 0
  10. if string_1 == 'USD':
  11.     bgnValue = current_currency * USD_TO_BGN_EXCCHANGE_RATE
  12. elif string_1 == 'BGN':
  13.     bgnValue = current_currency
  14. elif string_1 == 'EUR':
  15.     bgnValue = current_currency * EUR_TO_BGN_EXCHANGE_RATE
  16. elif string_1 == 'GBP':
  17.     bgnValue = current_currency * GBP_TO_BGN_EXCHANGE_RATE
  18.  
  19. convertedValue = 0
  20. if string_2 == 'USD':
  21.     convertedValue = bgnValue / USD_TO_BGN_EXCCHANGE_RATE
  22. elif string_2 == 'BGN':
  23.     convertedValue = bgnValue
  24. elif string_2 == 'EUR':
  25.     convertedValue = bgnValue / EUR_TO_BGN_EXCHANGE_RATE
  26. elif string_2 == 'GBP':
  27.     convertedValue = bgnValue / GBP_TO_BGN_EXCHANGE_RATE
  28.  
  29. print(f'{convertedValue:0.2f} {string_2}')
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement