[Tutor] General construction of alpha lists?
amk at amk.ca
amk at amk.ca
Wed Oct 22 07:17:42 EDT 2003
On Tue, Oct 21, 2003 at 09:42:46PM -0400, Clay Shirky wrote:
> So I have this bit of code:
> class_groups[next:next+1] = []
'del class_groups[next]' will also work.
BTW, there is a random.shuffle() function which generates a permutation of a
list, though it does it by randomly exchanging list elements.
> and then have it print from A through L. Is there an easy way to specify a
> list that is simply letters in order, or do I have to write out
Easiest is probably list(string.ascii_letters), or
list(string.ascii_lowercase). string.letters is the list of letters for the
current locale, and therefore will usually include a bunch of accented
characters; the .ascii_* variables are fixed.
--amk
More information about the Tutor
mailing list