Python-生成随机验证码

此页面是否是列表页或首页?未找到合适正文内容。

Python-生成随机验证码

标签:styledivclassport==codeand生成imp

import random

##生成随机验证码

def make_code(n):
res = ‘‘
for i in range(n):
current = random.randint(0,n)
if current == i:
tmp = chr(random.randint(65,90))
else:
tmp = random.randint(0,9)
res += str(tmp)
print(res)

make_code(5)

Python-生成随机验证码

标签:styledivclassport==codeand生成imp

原文地址:https://www.cnblogs.com/Xuuuuuu/p/9490285.html

作者: liuzhihao

为您推荐

返回顶部