随机验证码 数字+字母

import random
temp = ''
for i in range(4):
    red1 = random.randrange(0,4)
    if red1 == 1 or red1 == 3:
        temp += str(red1)
    else:
        red = random.randrange(65,91)
        c = chr(red)
        temp += c
print(temp)

 

posted @ 2017-11-08 16:44  口水哥  阅读(177)  评论(0编辑  收藏  举报