File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,11 @@ def gen_sequence(
1414 str .punctuation ,
1515 ]
1616 sequence = ""
17- for x in range (len (conditions )):
18- if conditions [x ]:
19- sequence += possible_characters [x ]
17+ keys = ["lowercase" , "uppercase" , "digits" , "punctuation" ]
18+
19+ for key , chars in zip (keys , possible_characters ):
20+ if conditions [key ]:
21+ sequence += chars
2022 else :
2123 pass
2224 return sequence
@@ -54,7 +56,7 @@ def show_has_characters(cls):
5456 print (cls .has_characters ) # print the output
5557
5658 def generate_password (self , lenght ):
57- sequence = PasswordGenerator .gen_sequence (list ( self .has_characters . values ()) )
59+ sequence = PasswordGenerator .gen_sequence (self .has_characters )
5860 print (PasswordGenerator .gen_password (sequence , lenght ))
5961
6062
You can’t perform that action at this time.
0 commit comments