2015年3月14日
摘要: 4.6. Defining FunctionsWe can create a function that writes the Fibonacci series to an arbitrary boundary:我们创建一个斐波那契数列的函数:>>> def fib(n): # write F... 阅读全文
posted @ 2015-03-14 20:21 Jeremy123 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 4.1. if StatementsPerhaps the most well-known statement type is the if statement. For example:if语句可能是最常见的控制流语句了,例如:>>> x = int(input("Please enter an ... 阅读全文
posted @ 2015-03-14 15:40 Jeremy123 阅读(706) 评论(0) 推荐(0) 编辑
摘要: 3.1.3. ListsPython knows a number of compound data types, used to group together other values. The most versatile is the list, which can be written as... 阅读全文
posted @ 2015-03-14 00:32 Jeremy123 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 3.1. Using Python as a CalculatorLet’s try some simple Python commands. Start the interpreter and wait for the primary prompt, >>>. (It shouldn’t take... 阅读全文
posted @ 2015-03-14 00:09 Jeremy123 阅读(323) 评论(0) 推荐(0) 编辑