Apr-13-2017, 09:40 PM
Just use your original set comprehension with first "text" replaced with "w" and without "()" after punctuation, as wavic posted.
cypher = {w.strip(punctuation) for w in text.split()}String methods do not work in-place, so your original for loop did not remove punctuation at all.