03 2013 档案

摘要:前段时间在LearnStreet网络学习平台上学习了Python入门课程《Python for Beginners》,对Python语言有了一个初步的认识。接下来将以《Python基础教程》(第2版)为主要参考书,对Python语言进行更为深入地学习。《Python基础教程》读书笔记系列文章将针对每一章中重要的知识点进行记录和整理。文章中的编程练习是在基于Python2.7.3版本的交互式解释器中进行的。第1章 基础知识1. 双斜线操作符// (P9)作用:实现整除操作,无论操作数是整数还是浮点数。如:>>> 7.0 / 2.03.5>>> 7.0 // 2 阅读全文
posted @ 2013-03-20 00:34 极客火腿 阅读(793) 评论(0) 推荐(0)
摘要:《Python for Beginners》为LearnStreet上的Python入门课程。本节主要学习内容分为两部分:1. Scoping and Mutability(变量作用域与可变性)2. Classes and Objects(类和对象)Lesson 8 Scoping and Mutability1. Global and Local Variables全局变量和局部变量1 >>> name = "Gladys"2 >>> other_name = "Mario the plumber"3 >> 阅读全文
posted @ 2013-03-18 18:47 极客火腿 阅读(430) 评论(0) 推荐(0)
摘要:《Python for Beginners》为LearnStreet上的Python入门课程。本节主要学习内容为Dictionaries(字典)。Lesson 7 Dictionaries1. Indexing Dictionaries查找字典练习1 def run():2 family = {"dad": 60, "mom" : 58, "brother": 20, "sister" : 15, "me" : 10}3 return family["brother"]4 5 阅读全文
posted @ 2013-03-18 18:28 极客火腿 阅读(456) 评论(0) 推荐(0)
摘要:原文:http://www.math.ecnu.edu.cn/~jypan/Teaching/cpp/cpp_operator_cn.png 阅读全文
posted @ 2013-03-18 12:23 极客火腿 阅读(235) 评论(0) 推荐(0)
摘要:《Python for Beginners》为LearnStreet上的Python入门课程。本节主要学习内容为Lists and Tuples。Lesson 6 Lists and Tuples1. Length of List计算List变量的长度。1 def run(var):2 #return your code here3 return len(var)4 5 #This is just for you to see what happens when the function is called6 print run([1,2,3,4,5])输出结果:52. Rem... 阅读全文
posted @ 2013-03-14 14:35 极客火腿 阅读(416) 评论(0) 推荐(0)
摘要:《Python for Beginners》为LearnStreet上的Python入门课程。本节主要学习内容为循环语句。一、基本语法1. while循环 下面两种写法是等价的:while flag:while flag == True:2. for循环for x in range(0,3):range(0,3) 执行的有效值范围为[0,1,2], 并且同range(3)是等价的。二、编程练习1. Incrementing and Decrementing1 def run(first, second):2 #your code here3 first +=14 sec... 阅读全文
posted @ 2013-03-09 21:14 极客火腿 阅读(411) 评论(0) 推荐(0)
摘要:《Python for Beginners》为LearnStreet上的Python入门课程。本节主要学习内容为条件语句。Lesson 4 Control Flow and Conditionals1. 第一个Python函数 1 def check_wounds(): 2 #your code here 3 arms = 0 4 if arms == 1: 5 return "tis but a scratch" 6 elif arms == 0: 7 return "flesh wound" 8 else: 9 ... 阅读全文
posted @ 2013-03-06 20:58 极客火腿 阅读(444) 评论(0) 推荐(0)
摘要:《Python for Beginners》为LearnStreet上的Python入门课程。本节主要学习内容为字符串。一、基本概念1. Indexing - References a specific element of a sequence. The first element in a sequence is found at the index 0. To use a single element, call it with [], like this: variable_name[index].首元素的索引值为0。2. Negative Indexing - This allows 阅读全文
posted @ 2013-03-05 19:23 极客火腿 阅读(358) 评论(0) 推荐(0)
摘要:此文将记录该月份本人曾阅读过的感觉比较有价值的网络文章的链接,并会不断更新直到创建下一月份的阅读链接。2013.3.11.眼睛直观感受几种常用排序算法2.为什么要写技术博3.博客园小技巧4.Python简史2013.3.41.程序猿玩家细说GTX 680轻取百万线程代码2013.3.51.编程,学校不会教你的课程——Code.org宣传片2.C++程序员的阅读清单3.如何成为强大的程序员?4.很酷的C语言技巧5.Python十分钟入门2013.3.71.Python完全新手教程2013.3.141. 《Rework》摘录及感想2. Stay Hungry, Stay Foolish2013.3 阅读全文
posted @ 2013-03-01 09:53 极客火腿 阅读(162) 评论(0) 推荐(0)