Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Itertools Help Please
#3
(Apr-01-2018, 11:36 PM)scidam Wrote:
for item in  map(''.join, product(*sets)):          
    print("Combination: ", item)
Output:
... ... Combination: ABJQ Combination: ABJW Combination: ABJE Combination: ABKQ Combination: ABKW Combination: ABKE ....
This is exactly what I wanted, Thanks. I had thought of something similar but it was missing the * so it was not working right.
Thanks sooo much! Major headache solved.
Reply


Messages In This Thread
Itertools Help Please - by jarrod0987 - Apr-01-2018, 11:30 PM
RE: Itertools Help Please - by scidam - Apr-01-2018, 11:36 PM
RE: Itertools Help Please - by jarrod0987 - Apr-01-2018, 11:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  itertools and amazing speed Pedroski55 8 2,104 Nov-11-2022, 01:20 PM
Last Post: Gribouillis
  What happens to a <itertools.permutations object at 0x7fe3cc66af68> after it is read? Pedroski55 3 2,431 Nov-29-2020, 08:35 AM
Last Post: DeaD_EyE
  Making lists using itertools and eliminating duplicates. mike3891 2 2,258 Oct-26-2020, 05:39 PM
Last Post: bowlofred
  Python3 itertools.groupby printing the key august 1 2,111 Aug-17-2020, 05:46 AM
Last Post: bowlofred
  Generate Cartesian Products with Itertools Incrementally CoderMan 2 1,866 Jun-04-2020, 04:51 PM
Last Post: CoderMan
  itertools.zip_shortest() fo unequal iterators Skaperen 10 6,791 Dec-27-2019, 12:17 AM
Last Post: Skaperen
  can itertools compact a list removing all of some value? Skaperen 6 3,199 Sep-02-2019, 03:19 AM
Last Post: Skaperen
  Help with itertools jarrod0987 1 1,829 Jun-10-2019, 02:41 AM
Last Post: Larz60+
  ImportError: No module named jaraco.itertools in Python manhnt 0 3,001 Nov-08-2018, 11:41 AM
Last Post: manhnt
  Need help with itertools.islice() Charles1 2 2,851 Sep-19-2018, 10:32 AM
Last Post: Charles1

Forum Jump:

User Panel Messages

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