
python
jlnhyd
一定要三思而后行!
展开
-
python 核心编程 笔记 draft
Charapter 1 C 语言中的混杂数组(Python 中的列表)和哈希表(Python 中的字典) PythonWin 通 常 被 安 装 在 和 Python 相 同 的 目 录 中 , 在 它 自 己 的 安 装 目 录C:/Python2x/Lib/site-packages/pythonwin 中 有 可 执 行 的 启 动 文 件 pythonwin.exe 。原创 2009-03-25 16:17:00 · 799 阅读 · 0 评论 -
python useful links
1.ibm http://www.ibm.com/developerworks/cn/linux/theme/special/index.html#python原创 2009-04-14 17:50:00 · 458 阅读 · 0 评论 -
python error
1. IndentationError: expected an indented block------缩进问题>>> for i in [1,2,3,4]:... t = s + i File "", line 2 t = s + i ^IndentationError: expected an indented block 修改后>>> fo原创 2009-04-21 14:46:00 · 587 阅读 · 0 评论 -
TIME
$ pythonPython 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import time>>> now = time.localtime()----------原创 2009-05-04 11:11:00 · 481 阅读 · 0 评论 -
python 核心编程 练习题
chapter 33-1. 标识符。为什么 Python 中不需要变量名和变量类型声明?答:因为变量在第一次赋值的时候就被自动声明了。 3–2. 标识符。为什么 Python 中不需要声明函数类型?答:我想和变量一样,是动态类型, 在创建--也就是赋值时,解释器会根据语法和右侧的操作数来决定新对象的类型。在对象创建后,一个该对象的应用会被赋值给左侧的变量。原创 2009-05-04 17:10:00 · 4978 阅读 · 1 评论 -
4.5.2对象身份比较
整数对象和字符串对象是不可变对象,所以 Python 会很高效的缓存它们。这会造成我们认为 Python 应该创建新对象时,它却没有创建新对象的假象。 >>> foo1 = 4.3>>> type(foo1)>>> type(4.3)>>> fool is 4.3Traceback (most recent原创 2009-05-12 10:51:00 · 667 阅读 · 0 评论 -
Python list中的[None] & [0]
>>> sabcde>>> for i in [None] + range(-1,-len(s), -1):... print s[:i]... abcdeabcdabcaba>>> sabcde>>> for i in [0] + range(-1,-len(s), -1):... print s[:i]... abcdabcaba>>> print s[:0]>>原创 2009-05-12 16:00:00 · 4645 阅读 · 0 评论 -
列表中元素是有序--python
>>> list1 = [1,2,3]>>> list2 = [2,3,1]>>> list1 == list2False>>> list1 is list2False>>> list3 = [1,2,3]>>> list1 == list3True>>> list1 is list3False>>>原创 2009-05-21 14:18:00 · 7786 阅读 · 0 评论