Skip to content

Instantly share code, notes, and snippets.

@CodeMaster7000
Created December 24, 2022 18:11
Show Gist options
  • Save CodeMaster7000/5e294652368d577fb1373839092d9b6b to your computer and use it in GitHub Desktop.
Save CodeMaster7000/5e294652368d577fb1373839092d9b6b to your computer and use it in GitHub Desktop.
A handy currency converter coded in Python.
from forex_python.converter import CurrencyRates
import time
cr = CurrencyRates()
amount = int(input("Enter the amount you want to convert: "))
time.sleep(1)
from_currency = input("Enter the currency code to be converted: ").upper()
time.sleep(1)
to_currency = input("Enter the currency code to convert to: ").upper()
time.sleep(1)
print("Summary: You are converting", amount, from_currency, "to", to_currency)
time.sleep(2)
output = cr.convert(from_currency, to_currency, amount)
print("The converted rate is:", output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment