splitting tables

Skip Montanaro skip at pobox.com
Tue Feb 10 20:28:41 EST 2004


    robsom> ... I (still) don't like the "for in range()" way to build
    robsom> loops.

That's needed only when you need a numeric index.  Much of the time you can
just iterate over a container object:

    for element in mylist:
        print element

or

    for key in mydict:
        print (key, mydict[key])

Skip




More information about the Python-list mailing list