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):