3 ms·
I was looking for set comprehensions but couldn't find info about it. Thanks for the tip.
by Kilimanjaro 16y ago
I was looking for set comprehensions but couldn't find info about it. Thanks for the tip.
- iclelland 16y agoThat's actually a set being constructed from a generator expression -- a real set comprehension would look like this: subset = {word for word in valid if len(word)==n} but that's only available in Python 3.0.1+ or 2.7