Skip to Main Content
Learning Python
book

Learning Python

by Mark Lutz, David Ascher
April 1999
Beginner content levelBeginner
384 pages
11h 15m
English
O'Reilly Media, Inc.
Content preview from Learning Python

Chapter 2. Types and Operators

This chapter begins our tour of the Python language. From an abstract perspective, in Python we write programs that do things with stuff.[8] Programs take the form of statements, which we’ll meet later. Here, we’re interested in the stuff our programs do things to. And in Python, stuff always takes the form of objects. They may be built-in kinds of objects Python provides for us, or objects we create using Python or C tools. Either way, we’re always doing things to objects in Python.

Naturally, there’s more to Python development than doing things to stuff. But since the subjects of Python programs are the most fundamental notion in Python programming, we start with a survey of Python’s built-in object types.

Python Program Structure

By way of introduction, let’s first get a clear picture of how what we study in this chapter fits into the overall Python picture. From a more concrete perspective, Python programs can be decomposed into modules, statements, and objects, as follows:

  1. Programs are composed of modules.

  2. Modules contain statements.

  3. Statements create and process objects.

[8] Pardon our formality: we’re computer scientists.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Python

Learning Python

Fabrizio Romano
Getting Started with Python

Getting Started with Python

Fabrizio Romano, Benjamin Baka, Dusty Phillips

Publisher Resources

ISBN: 1565924649Supplemental ContentCatalog PageErrata