A Byte of Python

A Byte of Python

Swaroop C H

www.byteofpython.info

Version 1.50

This book is released under the Creative Commons Attribution-NonCommercial-ShareAlike License 2.0.

Abstract

This book will help you to learn the Python programming language. This book is meant for readers with zero programming experience. However, experienced programmers can benefit from this book as well.


Table of Contents

Preface
Audience
History Lesson
Status of the book
Official Website
License Terms
Feedback
Mailing List
Something To Think About
1. Introduction to Python
What is Python?
Features of Python
Summary
Why not Perl?
What Programmers Say
2. Installing Python
For Windows users
Using Python at the Windows prompt
For Linux/BSD users
For Mac users
Summary
3. First Steps
Introduction
The interpreter prompt
Choosing an editor
Installing DrPython
Running DrPython
Using DrPython
Using a Source File
Output
How It Works
Executable Python programs
Getting Help
Introduction to the Hangman Gaming Room
The Hangman Gaming Room
Output
How It Works
Summary
4. The Basics of Python
Literal Constants
Numbers
Booleans
Strings
Variables
Identifier Naming
Data Types
Objects
Using Variables
Output
How It Works
Logical and Physical Lines
Indentation
The Hangman Gaming Room
Output
How It Works
Summary
5. Operators and Expression
Introduction
Operators
Operator Precedence
Order of evaluation
Associativity
Expressions
Output
How It Works
Summary
6. Control Flow
Introduction
The if statement
Output
How It Works
if-elif-else clauses

List of Tables

5.1. Operators and their usage
5.2.

List of Examples

4.1. Using Variables and Literal Constants
4.2. Adding the word to Hangman
5.1. Using Expressions
6.1. if statement
6.2. if-else statement
6.3. if-elif-else statement