11 随机生成验证码

import random

def get_random_code(length=6):
    data = []
    for i in range(length):
        v = random.randint(65,90)
        data.append(chr(v))

    return  ''.join(data)


code = get_random_code()
print(code)
posted @ 2024-07-24 21:48  jhchena  阅读(2)  评论(0编辑  收藏  举报