diff --git a/uebung_03/WordGenerator.py b/uebung_03/WordGenerator.py new file mode 100644 index 0000000..3814f85 --- /dev/null +++ b/uebung_03/WordGenerator.py @@ -0,0 +1,22 @@ +import itertools + +# Erlaubte Zeichen definieren +zahlen = ['0', '1', '2', '3', '4'] +buchstaben = ['d', 'e', 'f', 'g', 'h', 'i'] + +# Datei zum Speichern öffnen +output_datei = "passwortliste.txt" + +with open(output_datei, "w") as f: + # Alle Kombinationen durchgehen + for z1 in zahlen: + for z2 in zahlen: + for b1 in buchstaben: + for b2 in buchstaben: + for b3 in buchstaben: + for z3 in zahlen: + for z4 in zahlen: + passwort = f"{z1}{z2}{b1}{b2}{b3}{z3}{z4}" + f.write(passwort + "\n") + +print(f"Fertig! Passwortliste gespeichert unter: {output_datei}")