A language isn’t something you learn so much as something you join. —Arika Okrent
In order to define computational processes, we need a programming language; preferably one that many humans and a great variety of computers can all understand. In this text, we will work primarily with the Python language.
为了定义计算过程,我们需要一种编程语言;最好是一种许多人和各种计算机都能理解的语言。在本文中,我们将主要用Python语言工作
Python is a widely used programming language that has recruited enthusiasts from many professions: web programmers, game engineers, scientists, academics, and even designers of new programming languages. When you learn Python, you join a million-person-strong community of developers. Developer communities are tremendously important institutions: members help each other solve problems, share their projects and experiences, and collectively develop software and tools. Dedicated members often achieve celebrity and widespread esteem for their contributions.
Python是一种广泛使用的编程语言,它招募了许多职业的爱好者:网络程序员、游戏工程师、科学家、学者,甚至是新编程语言的设计师。当你学习Python时,你加入了一个百万人规模的开发者社区。开发者社区是非常重要的机构:成员们互相帮助解决问题,分享他们的项目和经验,并共同开发软件和工具。专注于此的成员常常因为他们的贡献而成为名人并受到广泛的尊敬。
The Python language itself is the product of a large volunteer community that prides itself on the diversity of its contributors. The language was conceived and first implemented by Guido van Rossum in the late 1980’s. The first chapter of his Python 3 Tutorial explains why Python is so popular, among the many languages available today.
Python语言本身是一个大型志愿者社区的产物,它以其贡献者的多样性而自豪。该语言是由Guido van Rossum在20世纪80年代末构思并首次实现的。他的《Python 3教程》的第一章解释了为什么Python在今天的众多语言中如此受欢迎。
Python excels as an instructional language because, throughout its history, Python’s developers have emphasized the human interpretability of Python code, reinforced by the Zen of Python guiding principles of beauty, simplicity, and readability. Python is particularly appropriate for this text because its broad set of features support a variety of different programming styles, which we will explore. While there is no single way to program in Python, there are a set of conventions shared across the developer community that facilitate reading, understanding, and extending existing programs. Python’s combination of great flexibility and accessibility allows students to explore many programming paradigms, and then apply their newly acquired knowledge to thousands of ongoing projects.
作为一种教学语言,Python非常出色,因为在它的整个历史中,Python的开发者一直强调Python代码的可解释性,并通过Python禅的指导原则—美观、简单和可读性—来加强。Python特别适合这篇文章,因为它广泛的功能支持各种不同的编程风格,我们将对此进行探讨。虽然在Python中没有单一的编程方式,但有一套开发者社区共享的惯例,以方便阅读、理解和扩展现有程序。Python的巨大灵活性和可及性相结合,使学生能够探索许多编程范式,然后将他们新获得的知识应用于成千上万的正在进行的项目。
These notes maintain the spirit of SICP by introducing the features of Python in step with techniques for abstraction and a rigorous model of computation. In addition, these notes provide a practical introduction to Python programming, including some advanced language features and illustrative examples. Increasing your facility with Python should come naturally as you progress through the text.
The best way to get started programming in Python is to interact with the interpreter directly. This section describes how to install Python 3, initiate an interactive session with the interpreter, and start programming.
这些笔记保持了SICP的精神,通过逐步介绍Python的特点与抽象的技术和严格的计算模型。此外,这些笔记还提供了对Python编程的实用介绍,包括一些高级语言特性和说明性的例子。随着课文的进展,增加你对 Python 的掌握应该是很自然的。 开始用 Python 编程的最好方法是直接与解释器交互。本节描述了如何安装 Python 3,启动与解释器的交互会话,并开始编程。