[Tutor] Shorten Code.

ALAN GAULD alan.gauld at btinternet.com
Fri Nov 18 19:15:11 CET 2011



> > for var in [value,value_1]:
> >    var = "green"
>
> Um, that won't work.   You typed that example too quickly.


Oops! Yes. You'd need to enumerate and access the variables
via an index. yuk. Don't do it folks! :-)

Excuse: It was early morning and I hadn't had any coffee...

Alan G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111118/2bb77e07/attachment.html>


More information about the Tutor mailing list