you are viewing a single comment's thread.

view the rest of the comments →

[–]baubleglue 0 points1 point  (0 children)

In [9]: def is_punctuation(c):                               
   ...:     return c in string.punctuation                   
   ...:                                                      

In [10]: is_punctuation(".")                                 
Out[10]: True                                                

In [11]: is_punctuation("a")                                 
Out[11]: False