亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

python中隨機函數(shù)random用法實例

 更新時間:2015年04月30日 11:20:27   作者:重負在身  
這篇文章主要介紹了python中隨機函數(shù)random用法,實例分析了random函數(shù)的相關使用技巧,非常具有實用價值,需要的朋友可以參考下

本文實例講述了python中隨機函數(shù)random用法。分享給大家供大家參考。具體如下:

python中的random模塊功能非常強大,可以生成各種隨機值

#! python
# random
import random
print random.choice(['apple', 'pear', 'banana'])
#從數(shù)組中隨機選擇一個元素
print random.sample(xrange(100), 10)
# sampling without replacement
print random.random()
# random float
print random.randrange(6)
# random integer chosen from range(6)

希望本文所述對大家的Python程序設計有所幫助。

相關文章

最新評論