import string
def generate_password(length):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password
# Set the desired length for the password
password_length = 12 # Change this to your desired password length
# Generate and print a random password
generated_password = generate_password("password_length")
print("Generated Password:", generated_password)
I am new to python, this is a code for a random possword generator and it is not working. Pls help
Aucun commentaire:
Enregistrer un commentaire