Python Forum
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Comprehension
#2
I am not sure if there is something like set comprehension.
You can use list comprehension and set() it.
sypher = set([w.strip(punctuation) for w in text(split)])
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
Set Comprehension - by Steven - Apr-13-2017, 09:18 PM
RE: Set Comprehension - by wavic - Apr-13-2017, 09:25 PM
RE: Set Comprehension - by zivoni - Apr-13-2017, 09:40 PM
RE: Set Comprehension - by Steven - May-26-2017, 03:12 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020