首页 > 其他 > 详细

random() 随机生成验证码

时间:2021-01-14 22:19:10      阅读:27      评论:0      收藏:0      [点我收藏+]

import random

choice = " "

for i in range(4):

     choice +=str(i)

print(choice)

 

 

加入随机:

import random
choice = ""
for i in range(4):
current = random.randrange(0,4)
if current == i:
tem =chr (random.randint(65,90))
else:
tem = random.randint(0,9)
choice +=str(tem)
print(choice)

random() 随机生成验证码

原文:https://www.cnblogs.com/nxb-1573/p/14279534.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!