Skip to main content

5.9) The String Module


If you like to loop over the alphabet, rather than having to type it all out, you can use some useful pre-defined strings from the string module. It’s a bit like importing the pi value from the math module.

>>> import string
>>> alphabet=string.lowercase
>>> alphabet
>>> Alphabet=string.uppercase
>>> Alphabet

String Module: http://docs.Python.org/2/library/string.html#