Python 生成验证码

temp2 = ""
for i in range(6):
    num = random.randrange(0,6)
    if num == 1 or num == 3 or num ==5:
        temp2 = temp2 + str(num)
    else:
        num2 =random.randrange(65,91)
        temp2 +=chr(num2)
print(temp2)

 

posted @ 2017-09-16 14:20  幽冥狂_七  阅读(162)  评论(0编辑  收藏  举报