import random
def v_code():
code = ‘‘
for i in range(5):
num=random.randint(0,9)
alf=chr(random.randint(65,90))
add=random.choice([num,alf])
code="".join([code,str(add)])
return code
print(v_code())
生成验证码
原文地址:https://www.cnblogs.com/duhong0520/p/11112487.html
时间: 2024-10-09 22:50:33