String module


In [ ]:
import string

print(string.ascii_letters)
print(string.ascii_lowercase)
print(string.ascii_uppercase)
print(string.hexdigits)
print(string.digits)
print(string.octdigits)
print(string.punctuation)
print(string.printable[: 94])
print(ascii(string.printable[94: ]))
print(ascii(string.whitespace))

In [ ]:
from string import capwords

print(capwords(' \n\n \tA ABC AbC   aBc AB-CD  a123,  A_$#   a*12 1abc _ab  \t\n '))
print(capwords(' \n\n \tA_*_ABC  _*_ AbC   aBc _*_AB-CD  a123,_*_A_$#  \t\n ', sep = '_*_'))