How to use string constant?

Terry Reedy tjreedy at udel.edu
Mon Jul 21 23:52:20 CEST 2014


On 7/21/2014 4:46 PM, fl wrote:
> Hi,
>
> I learn string constant on Python tutorial at:
> https://docs.python.org/2/library/string.html
>
> Although it gives explanation, it does not show me any example usage.
>
> Could you give me an example on using these options?
>
>
> string.digits
>
> string.ascii_letters

 >>> import string
 >>> 'a' in string.ascii_letters
True
 >>> 'a' in string.digits
False



-- 
Terry Jan Reedy




More information about the Python-list mailing list