10. Currency (+20 XP)


# Congrats!


Here's a recap of everything we learned in this chapter:

  • Data types: int, float, string.
  • Arithmetic operators: +, -, *, /.
  • The % modulo finds the remainder.
  • The ** exponentiation finds the exponent.
  • The input() method is used to get user input.
  • The int() method converts a value into an integer number.

# Instructions


Here's the final project of the chapter!

We just got back from a trip to Asia, specifically China, Japan, and South Korea. When we got back we have some leftover cash:

  • 🇨🇳 Chinese yuan
  • 🇯🇵 Japanese yen
  • 🇰🇷 South Korean won

Create a currency.py program that asks the user for the amount they have in yuan, yen, and won and calculates the total in USD.

Make sure to Google the current exchange rates!

The output of the program should look like this:

          
          What do you have left in yuan? 560
          What do you have left in yen? 2455
          What do you have left in won? 3280
          105.5275
          
        


Bonus: If you can complete this problem and you are a tryhard like me, go back to your code and try to change it into something else (crypto exchange, measurement conversion, different countries, etc).

Click "Code Review" and post a screenshot of your code to Twitter and then go to #CodedexCurrency to review two other people's work. Be supportive of your fellow coders!


Back

Solution: currency.py