[Tutor] create 1000 000 variables

Сергій kyxaxa at gmail.com
Sat Jul 15 22:28:01 CEST 2006


>
> And I don't like this "BAD CODE1" and "BAD CODE2"
>
> How to rewrite bad codes???
>

about "BAD CODE2" - I've fount a good solution (or it seems to me to be good
:) ):

"
tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']

for i in tags:
 Show_step(i)
 for j in getattr(parser, i):
  print j
"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060715/85d065fd/attachment.html 


More information about the Tutor mailing list