Division oddity

Tim Rowe tim at remove_if_not_spam.digitig.co.uk
Sun Jan 11 18:45:48 EST 2004


If I do from __future__ import division then eval(1/2) gives me 0.5 as
expected. But if I do print input("enter a sum: ") and enter 1/2 as
the sum I get 0 as if I hadn't done the import.  I thought input was
supposed to give the same behaviour as an eval on raw input -- why the
difference here?



More information about the Python-list mailing list