用python写个随机验证码
2021-07-19 14:08
标签:app print str dom 验证 == 随机验证码 pen har 用python写个随机验证码 标签:app print str dom 验证 == 随机验证码 pen har 原文地址:http://blog.51cto.com/2382492/2163223import random
li = []
for i in range(8):
r = random.randrange(0,5)
print(r)
if r == 2 or r == 4:
num = random.randrange(0,10)
li.append(str(num))
else:
temp = random.randrange(65,123)
char = chr(temp)
li.append(char)
print(li)
result = ‘‘.join(li)
print(result)