Pedro Izecksohn <izecks...@yahoo.com> writes:

> pedro@microboard:~$ /usr/bin/python3
> Python 3.3.2+ (default, Feb 28 2014, 00:52:16) 
> [GCC 4.8.1] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> 1-0.95
> 0.050000000000000044
>>>> 
>
>   How to get 0.05 as result?

print("%4.2f"%(1-0.95))

i.e., you can change how a result is displayed, not its internal
representation
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to