验证码

 1 import random
 2 
 3 def v_code():
 4 
 5     code = ''
 6     for i in range(5):
 7 
 8         num=random.randint(0,9)
 9         alf=chr(random.randint(65,90))
10         add=random.choice([num,alf])
11         code += str(add)
12     return code
13 
14 print(v_code())
原文地址:https://www.cnblogs.com/heluobing/p/10706613.html