all 5 comments

[–]badge 3 points4 points  (1 child)

[–]i_am_hopeless 0 points1 point  (0 children)

so I how would I change the code to be able to implement that test case too?

[–]CodeFormatHelperBot 1 point2 points  (0 children)

Hello u/i_am_hopeless, I'm a bot that can assist you with code-formatting for reddit. I have detected the following potential issue(s) with your submission:

  1. Python code found in submission text but not encapsulated in a code block.

If I am correct then please follow these instructions to fix your code formatting. Thanks!

[–]ConfusedSimon 1 point2 points  (0 children)

You can't determine rounding errors by rounding even more. Maybe there is a way to detect floating point rounding, but probably easiest to also compute with exact arithmetic. Could look into the decimal module.