+ 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
2 Respostas
+ 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)
0
interesting. i will try import string.thanx