Convert dollar to rupee with real time rate python
Created at 26-Aug-2022 ,
By samar
Convert dollar to rupee with real time rate python
With this article, we’ll look at some examples of how to address the "Convert dollar to rupee with real time rate python" problem.
There are lots of code snippet available which convert the dollar amount to indian rupee but here I want to convert dollar to rupee with real time rate. To convert dollar to ruppe with real time rate, you have to import `forex_python` library and use it to convet the amount.-
Covert dollar to rupee with real time rate in python
Import forex_python library
pip install forex_python
Code to convert dollar to rupee
from forex_python.converter import CurrencyRates c = CurrencyRates() amount = int(input("Enter the amount: ")) from_currency = input("From Currency: ").upper() to_currency = input("To Currency: ").upper() print(from_currency, " To ", to_currency, amount) result = c.convert(from_currency, to_currency, amount) print (result)
Run the python script
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Python
- How to remove whitespace from a string in Python
- Create Superuser django
- Delete superuser in django
- Error "Running Scripts Is Disabled On This System"
- Hello World Python Code Example
- Python for loop syntax
- How to pass default parameter value in Python function
- How can you use SQL queries on pydroid app?