标签:current def range temp code lse rand return int
1 def check_code(): #随机生成验证码
2 import random
3 checkcode = ‘‘
4 for i in range(4):
5 current = random.randrange(0, 4)
6 if current != i:
7 temp = chr(random.randint(65, 90))
8 else:
9 temp = random.randint(0, 9)
10 checkcode += str(temp)
11 return checkcode
标签:current def range temp code lse rand return int
原文地址:https://www.cnblogs.com/jeavy/p/9129973.html