random DEMO
来源:互联网 发布:数据透视表求和项为0 编辑:程序博客网 时间:2024/06/07 10:52
#quote from MIT 'introduction to computation and programming using python, Revised'import randomdef rollDie(): """Returns a random int between 1 and 6""" return random.choice([1,2,3,4,5,6]) def rollN(n): result = '' for i in range(n): result += str(rollDie()) print result for i in range(10): rollN(10)
%run "C:\Users\Administrator\test.py"
6116233436
3262112336
2216354654
6315621216
1444332142
3641155656
1141415133
5461363651
3214644263
2112262534
0 0
- random DEMO
- fortune random server demo
- pylab + random demo
- random walk DEMO
- random随机数demo小游戏
- stanford cs106b random.h demo
- random generator demo(Law of Large Numbers)
- random
- Random();
- random
- Random
- Random
- random
- Random
- Random
- Random
- Random
- Random
- 抽象类和接口
- 3.2 re--正则表达式操作(Regular expression operations)
- MAT Memory Analyzer Tool 插件装配(图解)
- 制作文件系统 BusyBox的交叉编译
- ubuntu在terminal下安装mysql
- random DEMO
- POJ 3006 Dirichlet's Theorem on Arithmetic Progressions(水~)
- ubuntu下部署jsp开发环境
- flip a coin(WLLN?)
- hdu 1023
- 跨平台移动APP开发进阶(一)mui开发注意事项
- 跨平台移动APP开发进阶(二)HTML5+、mui开发移动app教程
- 我的第一篇博客
- flip coins(more and more flips per each trial)(WLLN)