Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

https://repl.it/Cbqb unless your Python compiler runs on some sort of JavaScript (-:


  Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
  [GCC 5.4.0 20160609] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> 0.3 - 0.1
0.19999999999999998

Python 3.5.1 yields the same result


I don't use python, but print-like functions(or in this case, statements) usually format their output. https://repl.it/Cbqb/1

From the documentation:

> print evaluates each expression in turn and writes the resulting object to standard output (see below). If an object is not a string, it is first converted to a string using the rules for string conversions.

I can't even find what the rules for string conversions are in the documentation :/ Oddly enough they're not described under https://docs.python.org/2/reference/expressions.html#string-...


And while you're at it, do you know of any other language that does this? http://pasteboard.co/bbM0qneiQ.jpg




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: