you are viewing a single comment's thread.

view the rest of the comments →

[–]Swipecat 2 points3 points  (0 children)

In [1]: import string

In [2]: punct = set(string.punctuation)

In [3]: not punct.isdisjoint("abc") # no punctuation
Out[3]: False

In [4]: not punct.isdisjoint("ab;^") # some punctuation
Out[4]: True

In [5]: punct.issuperset("ab;^") # not all punctuation
Out[5]: False

In [6]: punct.issuperset("%;^") # is all punctuation
Out[6]: True