+ 2

Can I use the list(range()) function to print a list of strings like [a,b,c,d,e....]?

1st Jun 2017, 8:59 PM
Soumyadeep Mondal
Soumyadeep Mondal - avatar
3 Answers
+ 4
You can use list comprehension, like this: l = [chr(i) for i in range(97, 123)] ['a', 'b', ..., 'z']
1st Jun 2017, 9:59 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
0
you can use loops for it.
1st Jun 2017, 9:00 PM
Rose Sevenyears
Rose  Sevenyears - avatar
0
You can use defined constant like 'ascii_lowercase' from string module rather than convert every single character. Check this out: https://code.sololearn.com/cTRwmK1LB6En/?ref=app
2nd Jun 2017, 8:14 AM
Damian Tomalka
Damian Tomalka - avatar