+ 2

URGENT: How do I count up in letters?

Just like you can use for each in range(1, 100): print(each) can you do this for letters? This is without using hundreds of if elif statements and can be easily expanded If you know how to get it to count a-z please let me know, but if you can make it a-zz I would love to know (with y, z, aa, ab etc) Thanks

23rd Sep 2016, 6:34 AM
The Cool Dude
The Cool Dude - avatar
4 odpowiedzi
+ 2
print("Printing a-z") for i in range (97,123): print (chr(i)) print("Printing the combination of two character") for I in range (97,123): for j in range (97,123): print(chr(i)+chr(j))
24th Sep 2016, 5:52 PM
Md Mizanur Rahman
Md Mizanur Rahman - avatar
+ 1
Try this: start = ord('a') end = ord('z') + 1 for i in range(start, end): for j in range(start, end): print (chr(i) + chr(j))
23rd Sep 2016, 8:00 AM
Thomas Blank
Thomas Blank - avatar
0
Use Len(string) to get the count of letters in a string. not sure if you were asking the same.
2nd Nov 2016, 10:30 AM
RAMAKRISHNA RAMARAJU
RAMAKRISHNA RAMARAJU - avatar
- 3
a b c d e f g h i j k l m n o p q r s t u 9
23rd Sep 2016, 9:07 AM
Bub Bub