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))