Python - Display text in lowercase or uppercase

May 2017



Several solutions exist:

Using the map( )function


Display text in lowercase
print map (chr, range (97, 123))

Display text in uppercase
print map (chr, range (65, 91))

Using the libraries


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

Related


Published by jak58. Latest update on May 26, 2013 at 12:03 PM by jak58.
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).