-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
26 lines (19 loc) · 821 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import random
letras_minusculas = "abcdefghijklmnopqrstuvwxyz"
letras_mayusculas = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numeros = "0123456789"
simbolos = "!@#$%^&*()"
print("🔐 GENERADOR DE CONTRASEÑAS SEGURAS 🔐")
longitud = int(input("¿Longitud de la contraseña? (ej: 12): "))
usar_mayusculas = input("¿Incluir mayúsculas? (s/n): ").lower() == "s"
usar_numeros = input("¿Incluir números? (s/n): ").lower() == "s"
usar_simbolos = input("¿Incluir símbolos? (s/n): ").lower() == "s"
caracteres = letras_minusculas
if usar_mayusculas:
caracteres += letras_mayusculas
if usar_numeros:
caracteres += numeros
if usar_simbolos:
caracteres += simbolos
contraseña = "".join(random.choice(caracteres) for _ in range(longitud))
print("\n✅ Tu contraseña segura es:", contraseña)