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
10 changes: 10 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# Resolve the problem!!
import string
import random

SYMBOLS = list('!"#$%&\'()*+,-./:;?@[]^_`{|}~')


def generate_password():
# Start coding here
support_characters = string.ascii_letters + ''.join(SYMBOLS) + string.digits
max_length = random.randint(8,16)
result = ''.join(random.choice(support_characters) for i in range(max_length))

if validate(result) != True:
return generate_password()
else:
return result



def validate(password):
Expand Down