码迷,mamicode.com
首页 > 编程语言 > 详细

random python

时间:2014-08-18 14:13:35      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:des   io   ar   art   ad   python   on   sp   

random.randrange(stop)random.randrange(startstop[, step])

Return a randomly selected element from range(start, stop, step). This is equivalent to choice(range(start, stop, step)), but doesn’t actually build a range object.

>>> import random
>>> print random.randrange(1,10+1)

 

random.randint(ab)

Return a random integer N such that <= <= b.

random python,布布扣,bubuko.com

random python

标签:des   io   ar   art   ad   python   on   sp   

原文地址:http://www.cnblogs.com/hwei/p/3919358.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!