I've defined a class containing attributes and a print function, which prints the attributes of the class to the console. If I call the printing function like: object.printing_function() the desired value is printed, e.g. 0.24
However, when I access the attribute from without the class, like: object.attribute, the returned value is 0.23999999999999.
Print(object.attribute) gives 0.24 as well, how can I change the object.attribute to return 0.24?
I'm using: Spyder (Anaconda) Python 3.5
If the attribute is a floating point number you'll have to format the output if you are accessing the attribute directly: