Articles

Python program to convert us dollars to indian rupees

Python program to convert us dollars to indian rupees


In this python programming guide, we are going to learn to:

  • write a program to convert us dollar to indian rupees in python

Program to convert US Dollar to Indian Rupees in Python

Here we will take amount in usd from user and calculate the equivalent amount in Indian rupees. Here we are considering the value as Rs. 73/dollar.

 

Please check our video tutorial on program to convert us dollar to indian rupees in python:

 

 

The program to convert us dollar to indian rupees in python is as follows:

 

# Owner : TutorialsInhand Author : Devjeet Roy

usd = float(input("Enter currency in USD: "))
inr = usd * 73

print("The currency in INR is",round(inr,2))

The output of program to convert us dollar to indian rupees in python is as follows:

 

PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter currency in USD: 1234
The currency in INR is 90082.0

Few important tips about this program

1. We take user input and convert it to float data type.

2. While writing this program, 1 USD = 73 INR (Jan, 2021), so we convert USD to INR as per this rate.

3. Finally, we print the answer, rounding it off to 2 decimal places.

 

We can also make a small modification to above program to convert us dollar to indian rupees in python by accepting dollar value from user as well. Since the value of dollar keeps changing time to time. Try it yourself.

Snapshot for python program to convert us dollars to indian rupees:

program to convert us dollar to indian rupees in python

This wraps our session on write a program to convert us dollar to indian rupees in python, or python program to convert us dollars to indian rupees.


Python Conversion Programs

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com

About the Author
Devjeet Roy
Full Stack Web Developer & Blockchain Enthusiast
Page Views :    Published Date : Nov 11,2022  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!