随机验证码 数字+字母

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)
原文地址:https://www.cnblogs.com/koushuige/p/7804869.html