[Tutor] anomaly

Alan Gauld alan.gauld at yahoo.co.uk
Fri Apr 20 03:04:13 EDT 2018


On 20/04/18 05:53, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote:
> I have a situation in which the same code gives an error in idle but works
> in qtconsole
> regards,
> 
> *​in idle*
> v = np.zeros(len(x))
> 
> for i in range(len(x)):
>     if x[i] < 1.0:
>         v[i] = 0

You don't give us any clue to what x (or V) is,
so its hard to know what is going on.

Also how are you running the code in IDLE?
Are you running the same file using the Run
menu option? Or are you importing your module?

Also which Python version are you using?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list