[Tutor] range()-like function to generate aa, ... az, ..., zz ?

Chris Shenton chris at shenton.org
Thu Jul 28 19:59:26 CEST 2005


I'm looking for a range()-like function which could generate a list of
character-oriented tokens, like to iterate over all two-character
sequences like:

 pseudorange('aa', 'zz') would generate:
  aa, ab, ..., az, ba, ..., za, ..., zz

range() doesn't do character iteration, and I'm sure I could write  a
dumb function to do it, but was wondering if there was something more
generic -- e.g., later I might want

 pseudorange('aaa', 'mmm')

Anyway, is there a function to iterate through a range of character
strings similar to this? 

Thanks.


More information about the Tutor mailing list