Week 5 Transcript
Week 5 Transcript
Step-by-Step Approach:
1. Initialization:
o Declare a list of tuples exchange_rates containing currency codes and their respective
exchange rates to USD.
o Print a welcome message for the user, e.g., "Welcome to the Remitly Currency
Converter!".
o Iterate through exchange_rates and print each currency along with its exchange rate to
USD in a formatted manner for user clarity.
4. User Input:
o Prompt the user to input an amount in USD they wish to convert. Handle the input to
ensure it's a valid number (use float for conversion).
5. Conversion Calculations:
For each currency, multiply the USD amount by its exchange rate.
o Print the results for the first three currencies in the conversion_results list. Ensure the
amounts are printed with two decimal points for better readability.
o Print the results for the last three currencies in the conversion_results list (Note: Adjust
the indices correctly to pick the last 3 different currencies).
o Print a closing message thanking the user for using the currency converter.
Input Handling:
o Ensure all user inputs are validated properly (e.g., catch exceptions for non-float inputs).
Efficiency:
o Using list comprehensions and optimized loops where possible to minimize execution
time.
Steps Consolidated:
1. Initialize exchange_rates.