This workspace is provided for your convenience. You can use this activecode window to try out anything you like.
stringmodule provides several constants that are useful for these purposes. One of these,
string.digitsis equivalent to “0123456789”. It can be used to check if a character is a digit using the
string.ascii_lowercasecontains all of the ascii letters that the system considers to be lowercase. Similarly,
string.ascii_uppercasecontains all of the uppercase letters.
string.punctuationcomprises all the characters considered to be punctuation. Run the following: