Why is the Python math not working
In lemon.py in line 54, the math doesn't work if you do it more then one time. To see this, run the program, chose lemonade stand, and try to buy sugar more then one time, and the math messes up. I should have 8.85 but you get 8.8500000000000005. How do I fix?
That is because python is not good at math duh
fun fact: computers cant actually do decimals, this is one of them.
Here's how you can solve it:
def add_accurate(a, b): return (a * 100000 + b * 100000) / 100000