View Code
1 import random
2
3 def v_code():
4
5 ret=
" "
6 for i
in range(5
):
7 num=random.randint(0,9
)
8 alf=chr(random.randint(65,122
))
9 s=
str(random.choice([num,alf]))
10 ret+=
s
11 return ret
12
13 print(v_code())
转载于:https://www.cnblogs.com/xiaoliangliu86/p/11038555.html
相关资源:随机验证码,支持数字,字母混合,包含验证码校验等。