if op in ["/"]:
# rounding does not rounds half up so I imported a module
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_DOWN
Decimal(str(answer)).quantize(Decimal("1.11"), rounding=ROUND_HALF_UP)
Decimal(str(given_answer)).quantize(Decimal("1.11"), rounding=ROUND_HALF_UP)
print("correct {}".format(answer, ".2f"))
49//34=?1.44
correct 1
Wrong answer!
I want it to have the right answer as 3.56 if the real answer is 3.55865465. What am I doing wrong?
Try changing the last line to the following: