[Tutor] ZeroDivisionError: float division

pierre cutellic pierre.cutellic at gmail.com
Sat Oct 6 23:17:17 CEST 2007


Hi,
i'm actually stuck with a stupid syntax problem.

here is a a piece of code i can't debug:

kx = (neighbor[1]+agent[1])/(dx-(neighbor[1]+agent[1]))

in this line, 'neighbor[1]' and 'agent[1]' are both integers and 'dx' is a
float so it gives me the following error: 'ZeroDivisionError: float
division'.

And it is the same if i convert them into floats by float() function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071006/94ff5d20/attachment.htm 


More information about the Tutor mailing list