Use repr()
print(repr(sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])))
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
Out[2]: 0.
In ipython, I got the above output. But I got a different output from
print. Is there a way to print exact what I saw in ipython?
~/linux/test/python/man/library/math/fsum$ cat main.py
#!/usr/bin/env python
On Fri, Jul 6, 2012 at 3:38 PM, Peng Yu pengyu...@gmail.com wrote:
Hi,
In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
Out[2]: 0.
In ipython, I got the above output. But I got a different output from
print. Is there a way to print exact what I saw in ipython?