A Byte of Python - Swaroop C H

A Byte of Python

Swaroop C H

出版时间

2008-09-30

ISBN

9789577296467

评分

★★★★★

标签

编程

书籍介绍

'A Byte of Python' is a book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you.

AI导读
核心看点
  • 专为零基础设计的Python入门教程,内容短小精悍。
  • 通过简洁实例讲解语法,边读边练,快速上手编程。
  • 涵盖基础语法、数据结构及面向对象等核心概念。
适合谁读
  • 完全无编程经验,仅懂基本电脑操作的初学者。
  • 希望快速入门Python,寻找轻量级教程的读者。
  • 需要复习Python基础语法或快速回顾知识的开发者。
读前提醒
  • 书中版本较旧,建议结合Python 3官方文档对照阅读。
  • 部分印刷版存在格式解析错误,建议优先阅读电子版。
  • 内容较浅,适合入门,深入学习需搭配更厚重的教材。
读者共识
  • 公认的最佳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!"
作者简介
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.
目录
Table of Contents
1. Welcome
2. Dedication
3. Preface
4. Introduction

显示全部
用户评论
应该是我看的第一本Python书,简单了解下语法还不错
一年前看的英文电子版。 极好的入门书,短小精悍且内容详实。边读就边可以写一些简单的Python程序来,不用花很多时间就能读完。
fantastic, very helpful
Python的优势在于库超多,上手快,写起来爽;性能劣势明显,自构建特性混乱,语法糖太多
怎么说也是我的第一本编程书啊。。。
大二的时候入门读的,短小精悍,最适合我这种拖延症看
作为入门是极好的
找了网上的中文版,确实简明易懂,后面的编程内容有点难。
友好极速入门
作为入门确实简单明了,逻辑清晰。等我学成之日再回来评价好不好hhh。
收藏