[Tutor] all right students, what do we learn

Alan Gauld alan.gauld at btinternet.com
Mon Nov 3 01:31:55 CET 2014


On 02/11/14 21:49, Dave Angel wrote:

> But it doesn't.  print() returns None, which is false.
>

Oops, of course it does!
I got confused by looking in the interpreter which, of course,
printed out the string but I mistook it for a return value!

So in fact Clayton's code never executes the exec() at all
because an initial false in an and terminates evaluation.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list