From 785730f635e7df4ac6ebfb6e482f17d73de41c3e Mon Sep 17 00:00:00 2001 From: Marco Pardo Date: Sun, 13 Sep 2020 03:29:37 -0500 Subject: [PATCH] challenge complete --- src/main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index fc9a525..4a2d0b0 100644 --- a/src/main.py +++ b/src/main.py @@ -1,15 +1,20 @@ # Resolve the problem!! import string +import random SYMBOLS = list('!"#$%&\'()*+,-./:;?@[]^_`{|}~') +LETTERS = list(string.ascii_letters) +NUMBERS = list(string.digits) +character_list = SYMBOLS + LETTERS + NUMBERS +lenght_password = random.randint(8,16) def generate_password(): - # Start coding here - + passcode = random.sample(character_list,lenght_password) + password = ''.join(map(str,passcode)) + return password def validate(password): - if len(password) >= 8 and len(password) <= 16: has_lowercase_letters = False has_numbers = False