-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0208-116-3-2.py
More file actions
35 lines (31 loc) · 854 Bytes
/
0208-116-3-2.py
File metadata and controls
35 lines (31 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import random
ls = []
for i in range(ord('a'), ord('z') + 1):
ls.append(chr(i))
for i in range(ord('A'), ord('Z') + 1):
ls.append(chr(i))
for i in range(ord('1'), ord('9') + 1):
ls.append(chr(i))
ls_pwd = []
for j in range(61):
ls2 = ls.copy()
pwd = ''
for k in range(8):
while k == 0:
random_index = random.randint(0, len(ls2)-1)
random_value = ls2[random_index]
pwd += ls2.pop(random_index)
for m in ls_pwd:
if m[0] == pwd:
ls2.insert(random_index, random_value)
pwd = ''
break
else:
break
pwd += ls2.pop(random.randint(0, len(ls2)-1))
ls_pwd.append(pwd)
ls_one = []
for one in ls_pwd:
ls_one.append(one[0])
print(len(set(ls_one)))
# print(ls_pwd)