Range of characters?

Chris Dutton cmbchris at mac.com
Wed Dec 26 23:10:02 EST 2001


in article 3C2A074D.8214E5E0 at earthlink.net, Mari Mcdade at
wurmy at earthlink.net wrote on 12/26/01 12:27 PM:

> You don't need the string module, really, but using the literal
> string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" seemed a bit ugly. ;-)

Well, this is even less ugly then.

from string import uppercase as u
for c in u: 
    print "%sython" % c

or, in my new love, Ruby...

for c in "A".."Z"
    puts "%sython" % c
end




More information about the Python-list mailing list