Python - Display text in lowercase or uppercase


Several solutions exist:
Display text in lowercase

print map (chr, range (97, 123))

Display text in uppercase

print map (chr, range (65, 91))


Display text in lowercase and uppercase letters:

from string import ascii_letters
print ascii_letters

Another alternative:

import string
print string.ascii_lowercase
print string.ascii_uppercase

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Python - Display text in lowercase or uppercase », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).