The string module from Python's standard library contains many sets of characters.
Before you build your own, look here first.
Start by importing the module
import stringThe help file lists the available sets.
- whitespace -- a string containing all ASCII whitespace
- ascii_lowercase -- a string containing all ASCII lowercase letters
- ascii_uppercase -- a string containing all ASCII uppercase letters
- ascii_letters -- a string containing all ASCII letters
- digits -- a string containing all ASCII decimal digits
- hexdigits -- a string containing all ASCII hexadecimal digits
- octdigits -- a string containing all ASCII octal digits
- punctuation -- a string containing all ASCII punctuation characters
- printable -- a string containing all ASCII characters considered printable
string.ascii_uppercaseReturns a string with all of the uppercase ASCII characters.
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
string.hexdigits'0123456789abcdefABCDEF'
- Python documenation for the string module