随机生成验证码
作者:互联网
1 import random 2 #随机生成验证码 3 def check_code(): 4 checkcode = '' 5 for i in range(4): 6 current = random.randrange(0, 4) 7 if current != i: 8 temp = chr(random.randint(65, 90)) 9 else: 10 temp = random.randint(0, 9) 11 checkcode += str(temp) 12 return checkcode
标签:checkcode,temp,randint,random,验证码,生成,current,随机 来源: https://www.cnblogs.com/kingdy56/p/10691511.html