A Byte of Python

出版时间

2015-07-08

ISBN

9781514828144

评分

★★★★★
书籍介绍

Swaroop C H is 27 years of age. He is currently a Product Leader at Infibeam, one of the largest ecommerce companies in India. He has previously worked at Yahoo!, Adobe and his own startup.

AI导读
核心看点
  • Python基础语法与数据结构详解
  • 面向对象编程核心概念解析
  • 函数参数与默认值使用技巧
适合谁读
  • 零基础Python初学者
  • 具备其他语言基础的程序员
  • 希望快速掌握Python语法的读者
读前提醒
  • 建议阅读英文原版避免翻译歧义
  • 适合配合其他详细教程互补学习
  • 注意后半部分难度可能有所跳跃
读者共识
  • 内容简洁适合快速入门Python
  • 中文版部分翻译质量有待提升
  • 适合作为其他语言转Python的首选

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "Python的for循环与C#中的foreach循环十分类似。Java程序员会注意到它与Java 1.5中的for (int i : IntArray)相似。 在C/C++中,如果你想要写for (int i = 0; i < 5; i++) ,那么用Python,你写成for i in range(0,5)。"
  • "含有0个或1个项目的元组: 一个空的元组由一对空的圆括号组成,如myempty = ()。然而,含有单个元素的元组就不那么简单了。你必须在第一个(唯一一个)项目后跟一个逗号,这样Python才能区分元组和表达式中一个带圆括号的对象。即如果你想要的是一个包含项目2的元组的时候,你应该指明singleton = (2 ,)。"
  • "Python中的self等价于C++中的self指针和Java、C#中的this参考。 你一定很奇怪Python如何给self赋值以及为何你不需要给它赋值。举一个例子 会使此变得清晰。假如你有一个类称为MyClass和这个类的一个实例MyObject。当 你调用这个对象的方法MyObject.method(arg1, arg2)的时候,这会由Python自动转为 MyClass.method(MyObject, arg1, arg2)——这就是self的原理了。 这也意味着如果你有一个不需要参数的方法,你还是得给这个方法定义一个self 参数。"
  • "Important: Only those parameters which are at the end of the parameter list can be given default argument values i.e. you cannot have a parameter with a default argument value before a parameter without a default argument value in the order of parameters declared in the function parameter list. This"
  • "If you want to have keyword-only arguments but have no need for a starred parameter, then simply use an empty star without using any name such as def total(initial=5, *,vegetables)."
  • "Classes and objects are the two main aspects of object oriented programming. A class creates a new type where objects are instances of the class. An analogy is that you can have variables of type int which translates to saying that variables that store integers are variables which are instances (obj"
  • "Homework exercise: Checking whether a text is a palindrome should also ignore punctuation, spaces and case.For example, "Rise to vote, sir." is also a palindrome but our current program doesn't say it is. Can you improve the above program to recognize this palindrome?"
  • "Use help() to learn more about using help itself!"
用户评论
适合入门的教材
初学者很好的书
清晰,中译本太扯了,千万要看原版。
小白还是应该读详细一点的入门教程,这本太过简略,没有一点背景的话一定会读的一头雾水
适合作有其他编程语言基础程序员的第一本Python书
好多年前看的了,现在偶尔又翻了一遍,温故而知新,常常思考点最简单的,有助于理解复杂的
2018 中文版
最基础的书,可以一看
总的来说不错,作为入门教程
收藏