Python Forum
What is distinction between 'sent3' and 'set(sent3)'?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is distinction between 'sent3' and 'set(sent3)'?
#6
(Jul-09-2020, 03:51 AM)deanhystad Wrote: To be honest I am surprised that > and < don't throw an error when used with sets. The result is meaningless.

The operators when used with sets test for subset and superset.


>>> set([3]) < set([4, 5])  # first is not a subset of the second
False
>>> set([5]) < set([4, 5])  # first is a subset of the second
True
Reply


Messages In This Thread
RE: What is distinction between 'sent3' and 'set(sent3)'? - by bowlofred - Jul-11-2020, 07:59 AM

Forum Jump:

User Panel Messages

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