On Thu, 2009-01-15 at 12:19 +1000, Mr Gerard Kelly wrote: > Thanks very much > > I've noticed that the eval() function gives an integer, so eval("3/2") > gives back 1. float(eval("3/2")) doesn't seem to work, any way to get a > floating point number back with eval()? > > I know you can just do ("3./2."), but is there any way to do it with > just ("3/2")?
That's not the eval function returning that integer so much as it is Python itself. You might try: eval ("1.0 * 3/2") _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor