Advertisement
This is comment for paste
Password Generator
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- from string import ascii_letters, digits, punctuation
- def get_password_length():
- return int(input("Digite o comprimento desejado da senha: "))
- def generate_password(length, characters):
- return ''.join(choice(characters) for _ in range(length))
- def print_password(password):
- print("Senha gerada:", password)
- def generate_random_password():
- password_length = get_password_length()
- characters = ascii_letters + digits + punctuation
- password = generate_password(password_length, characters)
- return password
- if __name__ == "__main__":
- password = generate_random_password()
- print_password(password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement