Question: can you write a python code to do this, In this assignment, we will read a CSV file from the web which contains conversion rates.

can you write a python code to do this, In this assignment, we will read a CSV file from the web which contains conversion rates. Based on user input
we will convert a given currency amount. You can use any of the collections we have discussed in class to solve the
problem.
Specifications
Create a module called user_input to handle user input and output.
Create a module to manage the collections of currencies (finding, populating, etc). You should use a dict to
hold the currency information.
Prompt the user for the amount to be converted (valid positive float) DO NOT ASSUME the user will enter valid
data.
Prompt the user for the currency type: They can enter the Country, Currency, or Code and you may find more
than one match in the file. Make sure the comparison is case insensitive.
Make sure when you display the converted value, you show the original entered value, the calculated value, the
exchange rate, for all matches.
You will load the currencies from the following site:
o NOTE DO NOT download the file and include it in your file, read directly from the web.
o use website to get foreign currencyTest Case(s)
main
Enter the amount of currency >-8
Invalid, try again
Enter the amount of currency >35.6
35.6
Enter the Country Name, Currency Name, or Currency Code > shane
No matches found.
Process finished with exit code 0
main
Enter the amount of currency >45.8
45.8
Enter the Country Name, Currency Name, or Currency Code > dinAR
Converting 45.80 to the following currencies :
Kuwait rate of 0.35 is 16.05 Dinar (KWD)
Bahrain rate of 0.43 is 19.57 Dinar (BHD)
Jordan rate of 0.80 is 36.82 Dinar (JOD)
Tunisia rate of 3.68 is 168.59 Dinar (TND)
Libya rate of 5.46 is 249.89 Dinar (LYD)
Serbia rate of 134.54 is 6162.11 Dinar (RSD)
Algeria rate of 159.60 is 7309.59 Dinar (DZD)
Iraq rate of 1654.39 is 75771.10 Dinar (IQD)
Process finished with exit code 0
o NOTE You will need to get the URL for the most recent month!
o I would recommend opening the file in notepad so you can view the contents.
o NOTE: You can remove characters from a string using a slice.
NOTE: You can read from a website directly using:
o from urllib.request import urlopen
o file = urlopen(URL)
o for line in file:
Do not forget the Python Docstring (your grade will, in part, depend on the quality of these comments)
Do not forget to put a comment with your name and assignment at the top of the file.
 can you write a python code to do this, In this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!