initial commit
This commit is contained in:
11
zahlenraten/passwortgenerator.py
Normal file
11
zahlenraten/passwortgenerator.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
def generate_password(length=int) -> str:
|
||||
chars = string.ascii_letters + string.digits + string.punctuation
|
||||
|
||||
password = "".join(random.choice(chars) for _ in range(length))
|
||||
return password
|
||||
|
||||
length = int(input("Gib die Laenge deines Passwortes ein: "))
|
||||
print(generate_password(length))
|
||||
Reference in New Issue
Block a user