From 9578e2442a734107fdd49115bd85c63735851730 Mon Sep 17 00:00:00 2001 From: Jair Aguilar Date: Mon, 22 Jun 2020 21:14:47 -0500 Subject: [PATCH] Challenge complete --- .vscode/settings.json | 3 +++ src/main.py | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..615aafb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/usr/bin/python3" +} \ No newline at end of file diff --git a/src/main.py b/src/main.py index fc9a525..a6ae71e 100644 --- a/src/main.py +++ b/src/main.py @@ -1,12 +1,23 @@ # Resolve the problem!! -import string +import string, random SYMBOLS = list('!"#$%&\'()*+,-./:;?@[]^_`{|}~') def generate_password(): - # Start coding here + random_len = random.randint(8,16) + secure_password = '' + secure_password += SYMBOLS[random.randint(0, 27)] + secure_password += str(random.randint(0,9)) + #secure_password += + #secure_password += + + print(secure_password) + for element in range(0,random_len - 2): + secure_password += string.ascii_letters[random.randint(0,46)] + print(secure_password) + return secure_password def validate(password):