Advertisement
Guest User

Untitled

a guest
Jun 7th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. bgnRates = {
  2.   "USD": 1.79549,
  3.   "EUR": 1.95583,
  4.   "GBP": 2.53405,
  5.   "BGN": 1
  6. }
  7.  
  8. amount = float(input())
  9. sourceCurrency = input()
  10. targetCurrency = input()
  11.  
  12. bgnAmount = amount * bgnRates[sourceCurrency]
  13. resultAmount = bgnAmount / bgnRates[targetCurrency]
  14.  
  15. print(f'{resultAmount:0.2f} {targetCurrency}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement