Back
Instead of making a list of the alphabet like this:
alpha = ['a', 'b', 'c', 'd'.........'z']
Is there any way that we can group it to a range or something? For example, for numbers, it can be grouped using range()
range(1, 10)
To group an alphabet Range in Python you can use the following code:-
import string String.ascii_lowercase
import string
String.ascii_lowercase
If you want all the alphabet in the list then you can use the below-mentioned code:-
list(string.ascii_lowercase)
31k questions
32.8k answers
501 comments
693 users