top of page

Currency Convertor - Part A

  • Writer: Renee Li
    Renee Li
  • Oct 12
  • 1 min read

Another exercise of Code with Mosh, Python projects for beginner.


In this exercise, again, the logics are pretty simple and it took me around 15 minutes to get it done. However, the code I wrote is pretty smelly. I think with exchange rate dictionary, the code could be a lot shorter. I will refine the code in part B.


But for now, I will list the logics and display the implementations of what I have.


  • currency converter AUD USD CAD, with, USD = 1 , AUD =1.5, CAD = 1.25

  • user put amount and form source currency to target currency

  • validate user input amount and currency code try ValueError exception


currency convertor
currency convertor
currency convertor
currency convertor
currency convertor
currency convertor

Comments


bottom of page