Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from forex_python.converter import CurrencyRates
- c = CurrencyRates()
- cur = ['IDR', 'BGN', 'ILS', 'GBP', 'DKK', 'CAD', 'JPY', 'HUF', 'RON', 'MYR', 'SEK',
- 'SGD', 'HKD', 'AUD', 'CHF', 'KRW', 'CNY', 'TRY', 'HRK', 'NZD', 'THB', 'EUR', 'NOK',
- 'RUB', 'INR', 'MXN', 'CZK', 'BRL', 'PLN', 'PHP', 'ZAR']
- all_cur = set(cur)
- print("Какую валюту вы хотите перевести: ")
- while True:
- val_from = input()
- if val_from not in all_cur:
- print("Введите заново")
- else:
- break
- print("В какую валюту: ")
- while True:
- val_to = input()
- if val_to not in all_cur:
- print("Введите заново")
- else:
- break
- print("Сколько баблишка: ")
- n = int(input())
- print("Введите дату или напишите -:")
- date = input()
- if date == '-':
- a = c.convert(val_from, val_to, n)
- else:
- a = c.convert(val_from, val_to, n, date)
- print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement