随机生成验证码
来源:互联网 发布:c语言函数声明与调用 编辑:程序博客网 时间:2024/05/22 05:32
方法一:
#coding: utf-8
import random
import string
checkcode = ”
for i in range(4):
current = random.randrange(0,6)
if current != i:
temp = chr(random.randint(65,90))
else:
temp = random.randint(0,9)
checkcode += str(temp)
print checkcode
方法二
#coding: utf-8import randomimport stringzimu = string.ascii_lettersshuzi = string.digitsstr_source = zimu+ shuziprint ''.join(random.sample(str_source,4))
阅读全文
0 0
- 生成随机验证码
- 随机生成验证码
- 生成随机验证码
- 随机生成验证码
- 生成随机验证码
- 生成随机验证码
- 生成随机验证码
- 生成随机验证码
- 随机生成验证码
- 随机生成验证码
- 随机生成验证码
- 随机生成验证码
- 随机生成验证码
- 生成随机验证码
- 随机生成验证码
- 随机生成验证码
- 生成随机验证码
- 生成随机验证码
- OpenWrt下通过EC20 R2.0 4G模块实现qmi拨号上网
- 【国际】迪拜金融监管机构发布ICO警告
- 【观点】福布斯:区块链技术是否已发展成熟?
- Latch Free(闩锁释放)
- LintCode算法题解——岛屿个数、有效回文串、最长上升子序列
- 随机生成验证码
- E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- 【金融财经】金融市场一周简报(2017-09-15)
- 11g RAC INSTALL 准备工作part2
- java面试基础问题 整合
- LintCode算法题解——奇偶分割数组、二进制中1个数、反转整数、加一、排序数组转换为高度最小的二叉搜索树、二进制求和
- React学习
- leetcode 151. Reverse Words in a String 字符串分割逆序
- [Flink--计算引擎]--第三代计算引擎--Flink