From f929ad27088f4a4fc5c47428c7058296caa92803 Mon Sep 17 00:00:00 2001 From: heitzlki Date: Fri, 28 May 2021 11:33:02 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20create=20own=20version=20of=20passg?= =?UTF-8?q?en?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- passgen.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/passgen.py b/passgen.py index 7f22d6c..c532f7c 100644 --- a/passgen.py +++ b/passgen.py @@ -1,15 +1 @@ -import random -chars = ("abcdefghijklmnopqrstuvwxyz1234567890") -try: - anzahl = int(input("Wie viel Passwörter willst du haben?")) -except: - anzahl = 1 - print("Variable muss eine Zahl sein... autoassigned: 1") -try: - länge = int(input("passwort länge ?")) -except: - länge = 13 - print("Länge muss eine Zahl sein, autoassigned: 13") -for i in range(anzahl): - passwort ="".join(random.choices(chars,k = länge)) - print(passwort) \ No newline at end of file +import random;a,l=int(input("Amount:") or "1"), int(input("Length:") or "12");[print ("".join(random.choices("abcdefghijklmnopqrstuvwxyz1234567890",k=l))) for _ in range(a)]