Python Forum
looking for a permutation function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
looking for a permutation function
#1
i am looking for a permutation function (hoping i don't need to write one) that can take 3, 4, or 5 characters i give (no duplicats) and produce all possible combinations in every order (abcdef',fedcba','bdfeac',...) meeting these requirements:

1. no duplication of any letter.

2. every possible length from 1 to N. N is the number of different characters given.

3. every possible order

a generator is fine and probably preferred. i don't see anything in itertools that does this.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
looking for a permutation function - by Skaperen - Mar-24-2021, 10:51 PM
RE: looking for a permutation function - by buran - Mar-25-2021, 05:19 AM

Forum Jump:

User Panel Messages

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