Python模块random
来源:互联网 发布:淘宝潮流女装店铺 编辑:程序博客网 时间:2024/06/15 18:09
1、参考链接
https://docs.python.org/3/library/random.html
Python版本:3.5.3
2.常用函数
(1).随机整数
print random.randint(5, 30)(2).随机浮点数
0到1的随机浮点数print (random.random())
10到20的随机浮点数
print (random.uniform(10, 20))
(3).随机选取0到200间的偶数
print(random.randrange(0, 201, 2))(4).随机字符
print(random.choice('ASDFGHJKL;'!@#$%^'))print(random.choice ( ['运维架构师', '程序猿', '程序媛', 'DBA', 'DEVOPS'] ))
1 0
- Python random模块
- Python中的random模块
- Python 之 random模块
- python模块之----random
- python random模块
- python random模块
- Python random模块
- python random模块
- python的 random模块
- Python random模块
- python random模块
- Python中的random模块
- Python中的random模块
- python random模块
- Python random模块
- python random模块
- Python中的random模块
- Python中的random模块
- 如何在Unity中制作VR全景动画
- F4_Flash模拟EEPROM
- 漂泊的足迹
- intellij idea svn 修改文件后,父文件夹也标注修改
- 详解log4j2(下)
- Python模块random
- SpringMVC RestFul方式提交
- 我记得
- scala的传值参数和传名参数
- Detect Capital问题及解法
- 《Effective java 第2版》读书笔记--异常、并发与序列化
- 普通对象(不包括数组对象、Class对象)的创建
- Python练习题目1
- java大数处理hdu1002