Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@

def generate_password():
# Start coding here
caracteres = str(SYMBOLS) + string.ascii_letters + string.digits
longitud = random.randint(8,16)
minusculas = random.randint(1,4);
mayusculas = random.randint(1,4);
numeros = random.randint(1,4);
simbolos = random.randint(1,4);



while True:
password = ("").join(random.choice(caracteres) for index in range(longitud))
if(sum(caracter.islower() for caracter in password) >= minusculas
and sum(caracter.isupper() for caracter in password) >= mayusculas
and sum(caracter.isdigit() for caracter in password) >= numeros):
for caracter in password:
if caracter in SYMBOLS:
False
else:
True
break
return password


def validate(password):
Expand Down