Numeric array and for loops problem

Beni Cherniavsky cben at techunix.technion.ac.il
Tue Jan 7 13:29:26 EST 2003


On 2003-01-07, Wojtek Walczak wrote:

> Dnia 7 Jan 2003 05:29:48 -0800, Stan napisa³(a):
> >y += 1/2
> > Doesn't work.. i'm sorry for this stupid question but i'm quite new to
> > programming
> Try: y += 1/2.0
>
Putting the line ``from __future__ import division`` at the top of the
file is better yet.  It's intended precisely to make it less surprising
for new programmers and since this will one (far) day become the default
behaviour, I think using this "import" is the best thing to to recommend.

-- 
Beni Cherniavsky <cben at tx.technion.ac.il>





More information about the Python-list mailing list