Posted By

pr1001 on 02/14/08


Tagged

list alphabet


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

taboularasa
nefd


Generate List of Letters in the Alphabet


 / Published in: Python
 

  1. map(chr, range(97, 123))
  2. # ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  3.  
  4. map(chr, range(65, 91))
  5. # ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: ctran on October 27, 2008

from string import ascii_letters

ascii_letters

Posted By: df on April 4, 2009

[chr(i) for i in xrange(ord('a'), ord('z')+1)]

You need to login to post a comment.