Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Python/currency_conversion/currency_conv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import requests

# Where INR is the base currency you want to use
url = 'https://v6.exchangerate-api.com/v6/c724ae55d19e2fbee9d643bf/latest/INR'


# Making our request
response = requests.get(url)
data = response.json()

val = int(input("Enter Amount in USD : "))
# Your JSON object
#print(data['conversion_rates']['USD'])
conv_rate=data['conversion_rates']['USD']
amount_in_rs=val/conv_rate
print("Amount in RS",amount_in_rs)
13 changes: 13 additions & 0 deletions Python/currency_conversion/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Convert USD to INR
This python script converts input into INR by using exchange rate api

## setting up
you dont need to put any extra efforts ,python dev env setup will be fine to run this script

## running the script
```
python3 currency_conv.py
```

## example
![Screenshot from 2022-04-08 19-41-20](https://user-images.githubusercontent.com/46648301/162453586-7931952c-3ccf-4892-8541-fb3d4294cb59.png)