Code: Alles auswählen
from sys import *
from itertools import *
x="aba"
y = list(x)
shapes = ['a', 'b', 'c']
result = combinations_with_replacement(shapes, 3)
for i in result:
     a = list(i)
     print(a)
     if a == y:
            print("passwort: ", y)
            exit()
['a', 'a', 'a']
['a', 'a', 'b']
['a', 'a', 'c']
['a', 'b', 'b']
['a', 'b', 'c']
['a', 'c', 'c']
['b', 'b', 'b']
['b', 'b', 'c']
['b', 'c', 'c']
['c', 'c', 'c']
Also die Buchstaben wiederholen sich an stelle 1 und 2 oder 2 und 3 aber nicht bei 1 und 3.
Hat jemand eine Idee wie man das beheben kann?
Danke schonmal

 
 