-4

I wanna generate random passwords with this strings

Liste = ["Joseph", "_" , "9"]

like this passwords (Joseph_9, 9Joseph_, 9_Joseph)

How can i do this?

  • 2
    It doesn't seem like you want random so much _permutations_ of those three source strings. – jonrsharpe May 27 '22 at 12:31
  • what you've tried so far to achieve that? – Always Sunny May 27 '22 at 12:32
  • https://stackoverflow.com/questions/976882/shuffling-a-list-of-objects – DavidW May 27 '22 at 12:32
  • I just got 2 strings from the list using two random.choice(). And I randomly collected them. But with this way, I only use 2 of the strings in the list. Example: Joseph9 9Joseph Joseph_ – Emir Kutsal May 27 '22 at 12:38
  • What @jonrsharpe was trying to say: `print(list(''.join(s) for s in itertools.permutations(Liste)))`. Of course you will have to import `itertools` from Pythons standard library. – Matthias May 27 '22 at 12:40
  • @Matthias I was hoping the OP might be spurred to find that out themselves, given the appropriate keyword to describe the behaviour they wanted. – jonrsharpe May 27 '22 at 12:41
  • 1
    @jonrsharpe You have a point here. I should have linked to the documentation only. But let's hope for the best. – Matthias May 27 '22 at 12:47

0 Answers0