python&随机验证码

improt random

code = ''
for j in range(4):
num = str(random.randint(0, 9))
st = chr(random.randint(65, 90))
code += random.choice([num, st])
print(code)

posted @ 2021-06-26 23:29  陈皮是味药  阅读(33)  评论(0)    收藏  举报