We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d912880 commit c99df75Copy full SHA for c99df75
1 file changed
lwh/2/active_code.py
@@ -14,22 +14,9 @@
14
15
def generate_active_code():
16
active_code = []
17
- ascii_ = list(string.ascii_letters)
18
- for i in range(200):
19
- active_code_temp = ""
20
- for j in range(19):
21
- num_or_char = random.randint(0, 1)
22
- # 用"-"连接
23
- if j == 4 or j == 9 or j == 14:
24
- active_code_temp = active_code_temp + "-"
25
- # 生成数字
26
- elif num_or_char == 0:
27
- active_code_temp = active_code_temp + str(random.randint(0, 9))
28
- # 生成字符
29
- elif num_or_char == 1:
30
- active_code_temp = active_code_temp + \
31
- str(ascii_[random.randint(0, len(ascii_) - 1)])
32
- active_code.append(active_code_temp)
+ ascii_ = string.ascii_letters + string.digits
+ active_code = ["".join([random.choice(ascii_) for i in range(16)])
+ for i in range(200)]
33
34
return active_code
35
0 commit comments