images

This is a minimal introduction to Python, based on my popular web tutorial, “Instant Python” (http://hetland.org/writing/instant-python.html). It targets programmers who already know a language or two, but who want to get up to speed with Python. For information on downloading and executing the Python interpreter, see Chapter 1.

The Basics

To get a basic feel for the Python language, think of it as pseudocode, because that’s pretty close to the truth. Variables don’t have types, so you don’t need to declare them. They appear when you assign to them, and disappear when you don’t use them anymore. Assignment is done with the = operator, like this: ...

Get Beginning Python: From Novice to Professional, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.