ChinaUnix.net
相关文章推荐:

python 随机数

[color="#0000f0"] 随机整数: >>> import random >>> random.randint(0,99) 21 [color="#000080"]随机选取0到100间的偶数: >>> import random >>> random.randrange(0, 101, 2) 42 [color="#0000f0"]随机浮点数: >>> import random >>> random.random() 0.85415370477785668 >>> random.uniform(1, 10) 5.4221167969800881 [color="#0000f0"]随机字符: >>> import random >>> random.choice('abcdefg&#%^*f') 'd'...

by bj2008_0201 - Python文档中心 - 2008-09-11 10:27:44 阅读(1802) 回复(0)

相关讨论

随机整数: >>> import random >>> random.randint(0,99) 21 随机选取0到100间的偶数: >>> import random >>> random.randrange(0, 101, 2) 42 随机浮点数: >>> import random >>> random.random() 0.85415370477785668 >>> random.uniform(1, 10) 5.4221167969800881 随机字符: >>> import random >>> random.choice('abcdefg&#%^*f') 'd' 多个字符中选取特定数量的字符: >>> import random random.sample('...

by mystérieux - Python文档中心 - 2007-09-03 19:29:30 阅读(2882) 回复(0)

比如要生成0-1000之间的一个随机数?应该怎么办 多谢!

by godmatrix - Python - 2008-04-24 14:49:44 阅读(30064) 回复(5)

随机整数: >>> import random >>> random.randint(0,99) 21 随机选取0到100间的偶数: >>> import random >>> random.randrange(0, 101, 2) 42 随机浮点数: >>> import random >>> random.random() 0.85415370477785668 >>> random.uniform(1, 10) 5.4221167969800881 随机字符: >>> import random >>> random.choice('abcdefg&#%^*f') 'd' 多个字符中选取特定数量的字符: >>> import random random.sample('abcdefghij',3) ...

by alexnetwork - Python文档中心 - 2009-03-11 21:56:01 阅读(1046) 回复(0)

好好学python,以后要养家吃饭的!!! 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/89259/showart_1885773.html

by mzlinux - Python文档中心 - 2009-03-31 11:10:31 阅读(1371) 回复(0)

www.okpython.com python中国 这里有教程

by xieaotian - Python - 2009-01-10 12:53:11 阅读(1629) 回复(0)

在系统管理技术手册(第二版)说得很清楚了,perl\python都是不错的啊,学哪个都一样,只要够用就行了,菜鸟学python算了,刚好本站里面又推荐了一本<python核心编程>所以说最好是根据现有的资料学,可能会更顺利些。

by yizuwei520 - C/C++ - 2008-11-24 02:06:34 阅读(1743) 回复(3)

matrix processing for python: NumPy and SciPy. optimized tools: NumPy 方括号[...]定义一个列表,圆括号(...)定义一个元组,花括号{...}定义一个字典: a = [ 1, 3.4, 'hello' ] # A list b = ( 10, 20, 30 ) # A tuple c = { 'a': 3, 'b':42 } # A dictionary 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/17420/showart_492068.html

by ariesjzj - Python文档中心 - 2008-03-08 17:35:52 阅读(1389) 回复(0)

lvdbing@ubuntu:~$ python python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> lvdbing@ubuntu:~/python/app/python-3.0$ sudo make fullinstall lvdbing@ubuntu:~$ python python 3.0 (r30:67503, Dec 11 2008, 23:57:39) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more info...

by lvDbing - Python文档中心 - 2008-12-12 00:00:50 阅读(1878) 回复(0)

Programming python, 3rd Edition 介绍的例子 http://examples.oreilly.com/python3/ 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/20294/showart_1272424.html

by lvDbing - Python文档中心 - 2008-10-04 15:54:41 阅读(2121) 回复(0)

python () is shorthand for "python __anonymous ()". It declares an anonymous function, which is executed automatically at the end of parsing. for example we can modify package version python __anonymous () { import bb, re new_version = '3.0.0' bb.data.setVar('PV',new_version,d) 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinauni...

by linuxGentoo - Python文档中心 - 2007-10-01 23:36:15 阅读(1172) 回复(0)