currency conversion python program
Answers
Explanation:
Currency Converter – Python Project with Source Code
Are you looking to build a solid career in Python? If Yes, you have to work on projects. DataFlair is devoted to make you a successful Python Developer. After tons of tutorials, practicals, interview questions, we are coming with a series of projects from beginner to advanced level.
In this tutorial, we are going to build an exciting python project through which you can convert currencies. For a user interface, we are going to use the tkinter library
currency converter python project
Keeping you updated with latest technology trends, Join DataFlair on Telegram
Currency Converter in Python
Prerequisites
The currency converter project in python requires you to have basic knowledge of python programming and the pygame library.
tkinter – For User Interface (UI)
requests – to get url
To install the tkinter and requests library, type the following code in your terminal:
pip install tkinter
pip install requests
Answer:
Since it would be too complex an answer to get the correct currency value from the web and convert, we will only use 2 currencies.
Let's say:
70 rupees = 1 dollar
1 dollar = 1/70 rupees
In Python:
def rupee_to_dollar(r):
return r * 70
def dollar_to_rupee(d):
return d / 70
print(rupee_to_dollar(2)) # 140
print(dollar_to_rupee(350)) # 5
Hope it helped you. If you use another language, try to use the same logic I used. Please mark as brainliest. Have a nice day!