Re: Print a float value
toggle quoted messageShow quoted text
In the first case you're printing the float, in the second case you're printing a tuple of floats. In both cases the `__str__` function is called, however in the case of the tuple, `__str__` and `__repr__` are the same so it's like calling `__repr__` of each of its items.
>>> class test(object):
... def __str__(self): return "__str__"
... def __repr__(self): return "__repr__"
>>> print(test(), test())
Hope this makes sense.
On Sat, Mar 21, 2020 at 7:08 PM Hailiang Shen <hailiang@...> wrote: