Python Forum
How to create subset in python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create subset in python?
#6
>>> n = 4
>>> [(i, j) for i in range(n) for j in range(i+1, n)]
[(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]
Reply


Messages In This Thread
How to create subset in python? - by Bhavika - Nov-27-2021, 09:30 AM
RE: How to create subset in python? - by Yoriz - Nov-27-2021, 10:11 AM
RE: How to create subset in python? - by Bhavika - Nov-27-2021, 02:42 PM
RE: How to create subset in python? - by deanhystad - Nov-27-2021, 03:03 PM
RE: How to create subset in python? - by Bhavika - Nov-27-2021, 04:19 PM
RE: How to create subset in python? - by Gribouillis - Nov-27-2021, 07:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  bug in subset sum algorithm usercat123 3 1,513 Feb-07-2022, 05:41 AM
Last Post: deanhystad
  how to refer to a subset of a list Skaperen 4 1,774 Jan-16-2022, 02:16 AM
Last Post: Skaperen
  Grabbing a Subset of a String acemurdoc 3 2,685 Jun-18-2019, 04:57 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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