Python之简单验证码实现

def v_code():
ret = ''
for i in range(5):
num = random.randint(0,9)
alf = chr(random.randint(65,122))
s = str(random.choice([num,alf]))
ret += s
return ret

print(v_code())
posted @ 2018-04-12 19:18  红桃6  阅读(348)  评论(0)    收藏  举报