Closed ayushmankumar7 closed 5 years ago
Okay. Lemme See what i can do
there are some errors in the code under Python3 . Maybe you need to iterate through the dict? 260 except ValueError: 261 raise IndexError('Cannot choose from an empty sequence') from None --> 262 return seq[i] 263 264 def shuffle(self, x, random=None):
TypeError: 'dict_keys' object is not subscriptable
Okay. Lemme See what i can do
based of your intial code . consider this as it seem to work with Python3 def generate_pass(length=21): """Function to generate a password"""
password = []
while len(password) < length:
key = choice([char_set["small"],char_set["big"],char_set["special"],char_set["nums"]])
a_char = urandom(1)
n = choice(key)
if n in key:
if check_prev_char(password, n):
continue
else:
password.append(n)
return ''.join(password)
Thanks for the help. Should i PR once again?
This looks good. Thank you .. approving the PR
This is not safe for security usage.