File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
import string
2
- from random import *
2
+ import random
3
3
4
- letters = string .ascii_letters
5
- digits = string .digits
6
- symbols = string .punctuation
4
+ letters = [ letter for letter in string .ascii_letters ]
5
+ digits = [ digit for digit in string .digits ]
6
+ symbols = [ symbol for symbol in string .punctuation ]
7
7
chars = letters + digits + symbols
8
+ random .shuffle (chars )
8
9
9
10
min_length = 8
10
11
max_length = 16
11
- password = '' .join (choice (chars ) for x in range (randint (min_length , max_length )))
12
- print ('Password: %s' % password )
12
+ password = '' .join (random . choice (chars ) for x in range (random . randint (min_length , max_length )))
13
+ print ('Password: ' + password )
13
14
print ('[ If you are thinking of using this passsword, You better save it. ]' )
You can’t perform that action at this time.
0 commit comments