Am working on a small math-checker using Python and everything works well except of divisions. Problem: The quotient with two decimals (2/3 = 0.67), float, is equal to an input (0.67). But the if-statement I use to compare a user's input with the result says it isn't equal.
Assumption: the problem is related to float.
My code:
result = float(value0 / value1)
result = round(result,2)
value3 = input("Number 1")
value3 = float(value3)
if result != value3:
print "Wrong!"
print result
elif result == value:
print "Right!"
Of course I could create a function with a different approach, but I am curious to understand why it doesn't work.
If there's a similar thread, please post the link and close this one. Thanks for any help.