[ Python - 5 ] 通过random模块生成随机字符串
2017-06-25 07:16
507 查看
import random checkcode = '' for i in range(4): if i == random.randint(0,3): current = chr(random.randrange(65,90)) checkcode += str(current) else: checkcode += str(i) print(checkcode)
View Code
相关文章推荐
- day04_python random模块随机生成验证码
- Python随机生成数模块random使用实例
- Oracle通过dbms_random.string生成随机字符串
- 生成指定个随机字符串--我个人认为基本不会重复(测试时使用6位未见重复现象,完满通过)
- Python模块学习 ---- random 随机数生成
- Python之随机生成数random模块
- python通过xlwt模块直接在网页上生成excel文件并下载
- python生成随机密码或随机字符串的方法
- Python 中的random模块用于生成随机数
- Python模块学习 ---- random 随机数生成
- [PHP]利用openssl_random_pseudo_bytes和base64_encode函数来生成随机字符串
- python通过random方法生成255个字符的域名
- Python生成8位随机字符串的一些方法
- 使用random模块,生成动态随机密码 分类: python 小练习 python Module 2013-12-04 17:23 278人阅读 评论(0) 收藏
- Python生成8位随机字符串的一些方法 分类: python学习 2015-04-28 20:00 62人阅读 评论(0) 收藏
- Python模块学习--random 随机数生成
- python随机生成字符串学习
- Python格式化字符串和随机生成ip地址
- python生成随机密码或随机字符串的方法
- Python模块学习 ---- random 随机数生成