From 95ac98d7c57d55e4243d9bd04272f8b955c60a4b Mon Sep 17 00:00:00 2001 From: komal swami <46648301+komalswami@users.noreply.github.com> Date: Fri, 8 Apr 2022 19:43:46 +0530 Subject: [PATCH 1/2] readme.md --- Python/currency_conversion/readme.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Python/currency_conversion/readme.md diff --git a/Python/currency_conversion/readme.md b/Python/currency_conversion/readme.md new file mode 100644 index 000000000..e0172f4d7 --- /dev/null +++ b/Python/currency_conversion/readme.md @@ -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) From 1c943eed2fac2bd2f8b0f912e054c327e2c78060 Mon Sep 17 00:00:00 2001 From: komal swami <46648301+komalswami@users.noreply.github.com> Date: Fri, 8 Apr 2022 19:44:27 +0530 Subject: [PATCH 2/2] currency_conversion --- Python/currency_conversion/currency_conv.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Python/currency_conversion/currency_conv.py diff --git a/Python/currency_conversion/currency_conv.py b/Python/currency_conversion/currency_conv.py new file mode 100644 index 000000000..70112098f --- /dev/null +++ b/Python/currency_conversion/currency_conv.py @@ -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)