python
kutim
这个作者很懒,什么都没留下…
展开
-
第二部分 Types和Operations
第四章 python Object Types1. python概念上的层次结构Programs由modules组成, modules包含statements, statements包含expressions expressions创建、处理objects2. 为什么使用built-in类型built-in 对象让程序易于书写,built-in 对象是扩展类型的基石翻译 2015-04-22 20:11:15 · 518 阅读 · 0 评论 -
第二十~章 Functions and Generators
第二十章 Comprehensions and Generations1.List Comprehensions and Functional Tools1.1 List Comprehensions Versus map>>> res = list(map(ord, 'spam')) # Apply function to sequence (or other)翻译 2015-04-28 16:31:57 · 401 阅读 · 0 评论 -
第十六-十七章 Functions and Generators
第十六章 Function BasicsCoding Functionsdef is executable code.:函数可嵌套def creates an object and assigns it to a name.:function object,function name.lambda creates an object but returns it as a翻译 2015-04-27 13:34:21 · 350 阅读 · 0 评论 -
第十四章 Iterations and Comprehensions
“iterable objects”:an object is considered iterable if it is either a physically stored sequence, or an object that produces one result at a time in the context of an iteration tool like a for loop。翻译 2015-04-26 20:38:39 · 315 阅读 · 0 评论 -
第十五章 The Documentation Interlude
>>> import sys>>> help(sys.getrefcount)或者help('sys.getrefcount')翻译 2015-04-27 11:34:16 · 368 阅读 · 0 评论 -
第七章 String 基础
1.String Basics>>> title = "Meaning " 'of' " Life" # Implicit concatenation>>> title'Meaning of Life'>>> s = 'a\0b\0c'>>> s'a\x00b\x00c'myfile = open(r'C:\new\text.dat', 'w')翻译 2015-04-24 18:40:49 · 381 阅读 · 0 评论 -
第八章 List Dictionaries
1.List >>> len([1, 2, 3]) # Length3>>> [1, 2, 3] + [4, 5, 6] # Concatenation[1, 2, 3, 4, 5, 6]>>> ['Ni!'] * 4 # Repetition['Ni!', 'Ni!', 'Ni!', 'Ni!']>>> 3 in [1, 2, 3] # MembershipTrue翻译 2015-04-25 12:59:02 · 242 阅读 · 0 评论 -
第九章 Tuples, Files, and Everything Else
1.Tuples>>> (1, 2) + (3, 4) # Concatenation(1, 2, 3, 4)>>> (1, 2) * 4 # Repetition(1, 2, 1, 2, 1, 2, 1, 2)>>> T = (1, 2, 3, 4) # Indexing, slicing>>> T[0], T[1:3](1, (2, 3))>>> T = (翻译 2015-04-25 16:39:53 · 271 阅读 · 0 评论 -
第十三章 while and for Loops
1.while LoopsGeneral Format:while test: # Loop test statements # Loop bodyelse: # Optional else statements # Run if didn't exit loop with breakbreak, continue, pass, and the Loop else翻译 2015-04-26 16:51:32 · 251 阅读 · 0 评论 -
第十一章 Assignments, Expressions, and Prints
1.Assignment StatementsAssignments create object references.Names are created when first assigned.Names must be assigned before being referenced.Some operations perform assignments implicitly.翻译 2015-04-26 11:03:54 · 609 阅读 · 0 评论 -
第十二章 if Tests and Syntax Rules
1.if StatementsGeneral Formatif test1: # if test statements1 # Associated blockelif test2: # Optional elifs statements2else: # Optional else statements3>>> choice =翻译 2015-04-26 14:42:48 · 307 阅读 · 0 评论 -
第十章 Introducing Python Statements
1.Python’s Statements翻译 2015-04-25 20:52:25 · 363 阅读 · 0 评论 -
第五章 Numeric Types
1. Numeric Type Basics• Integer and floating-point objects• Complex number objects• Decimal: fixed-precision objects• Fraction: rational number objects• Sets: collections with numeric operat翻译 2015-04-23 17:01:53 · 825 阅读 · 0 评论 -
第十八-十九章 Functions and Generators
第十八章 Arguments1.Argument-Passing BasicsArguments are passed by automatically assigning objects to local variable names.Assigning to argument names inside a function does not affect the caller.翻译 2015-04-27 21:26:09 · 473 阅读 · 0 评论