Python list range | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Python list range

print(list(range(100))) #will print list 0 - 99 is there a function that similar with range but can print a - z? just asking

13th Aug 2017, 11:41 AM
Kevin AS
Kevin AS - avatar
2 Answers
+ 5
well, it depends how technical you wanna get: import string string.ascii_lowercase string.ascii_uppercase string.ascii_letters (contains both upper and lower) This imports the alphabet itself from ascii. There is an upper/lower/both versions. You can use it as so: for letter in string.ascii_lowercase: print (letter) or you can put it in a list of you really need to: list (string.ascii_lowercase) There is also a third option: letters = "abcdefghijklmnopqrstuvwxyz" for each in letters: print (each)
13th Aug 2017, 11:59 AM
Sapphire
0
interesting. i will try import string.thanx
13th Aug 2017, 12:01 PM
Kevin AS
Kevin AS - avatar