Workout #36: Sales Tax

Abish Pius
Python Workout
Published in
Oct 28, 2021

--

In this exercise, you’ll implement a somewhat complex (and whimsical) function, in a module, to implement tax policy in the Republic of Freedonia. The idea is that the tax system is so complex that the government will supply businesses with a Python module implementing the calculations for them.

Sales tax on purchases in Freedonia depends on where the purchase was made, as well as the time of the purchase. Freedonia has four provinces, each of which charges its own percentage of tax:

  • Chico: 50%
  • Groucho: 70%
  • Harpo: 50%
  • Zeppo: 40%

TRY IT YOURSELF

ANSWER

https://colab.research.google.com/drive/1GpnAi4qf3-4MwcQLDf3l0XkEhkdnSx3A?usp=sharing

--

--

Abish Pius
Python Workout

Data Science Professional, Python Enthusiast, turned LLM Engineer