From 99ebb80d7e1d0f00bdcb0e3094cd928492515a5a Mon Sep 17 00:00:00 2001 From: adriangutir7 Date: Fri, 7 Aug 2020 16:21:53 -0500 Subject: [PATCH] Solution to Challenge 02 Python by Adrian Gutierrez R C4 --- src/main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main.py b/src/main.py index fc9a525..b5e8b99 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,6 @@ # Resolve the problem!! import string +import random SYMBOLS = list('!"#$%&\'()*+,-./:;?@[]^_`{|}~') @@ -7,6 +8,20 @@ def generate_password(): # Start coding here + letter_uppercase = list(string.ascii_uppercase) + letter_lowercase = list(string.ascii_lowercase) + numbers = list(string.digits) + characters = SYMBOLS + letter_lowercase + letter_uppercase + numbers + password = [] + + for i in range(16): + character_random = random.choice(characters) + password.append(character_random) + + password = ''.join(password) + return password + + def validate(password):