#随机验证码生成 import random checkcode=‘‘ for i in range(4): conut = random.randrange(0,4) if conut == i: tmp = chr(random.randint(65,90)) else: tmp = random.randint(0,9) checkcode += str(tmp) print(checkcode)
原文:http://www.cnblogs.com/bruce61/p/7580185.html