- Go to the following directory path:
ch01
> exercises
- If not already present, create a new file:
touch currency.py
- Complete the following activity in
currency.py
- Make a commit (with any message you want), then push your changes back to the main repository.
Write Python code that will compute a money exchange using the Euro to US Dollar conversion rate.
The program should:
- Ask the user for the current exchange rate for the Euro to Dollar and save the result in a variable called:
rate
- Ask the user for the amount of currency to exchange and save the result in a variable called:
amount
- Remember that each of these will need to be
cast
to a usable data type. input() returns str type, and str can’t be used for math
- Calculate the total USD the user will receive from the exchange and save the result in variable called:
total
- Charge a $3.00 service fee by subtracting from the total and saving the result in a variable called:
result
- Print
result