Table of Contents

Chapter 1 - 

Introduction

x

Hello!x
Downloading and Installing Pythonx

Chapter 2 - 

"Hello World!" - Your First Program

x

Starting the Python Interpreterx
Some Simple Math Stuffx
Evaluating Expressionsx
Variablesx
Stringsx
Writing Programsx
Hello World!x
"My Favorite Stuff"x
Crazy Answers and Crazy Names for our Favorite Stuffx
Capitalizing our Variablesx

Chapter 3 - 

Guess the Number

x

Source Codex
Argumentsx
Blocksx
Conditions and Booleansx
if Statementsx
Step by Step, One More Timex
Some Changes We Could Makex
What Exactly is Programming?x
A Web Page for Program Tracingx

Chapter 4 - 

Jokes

x

How Programs Run on Computersx
Source Codex
Some Other Escape Charactersx
Quotes and Double Quotesx

Chapter 5 - 

Dragon World

x

Source Codex
def Statementsx
Boolean Operatorsx
Variable Scopex
Parametersx
Local Variables and Global Variables with the Same Namex
Where to Put Function Defintionsx
The Colon :x
Step by Step, One More Timex
Designing the Programx
A Web Page for Program Tracingx

Chapter 6 - 

Hangman

x

ASCII Artx
Source Codex
Designing the Programx
Multi-line Stringsx
Constant Variablesx
Listsx
Changing the Values of List Items with Index Assignmentx
List Concatenationx
The in Operatorx
Removing Items from Lists with del Statementsx
Lists of Listsx
Methodsx
The len() Functionx
The range() Functionx
for Loopsx
Strings Act Like Listsx
List Slicing and Substringsx
elif ("Else If") Statementsx
And that's it!x
Dictionariesx
Sets of Words for Hangmanx

Chapter 7 - 

Tic Tac Toe

x

Source Codex
Designing the Programx
Game AIx
List Referencesx
Short-Circuit Evaluationx
The None Valuex
A Web Page for Program Tracingx

Chapter 8 - 

Bagels

x

Source Codex
Augmented Assignment Operatorsx
The sort() List Methodx
The join() String Methodx
String Interpolationx

Chapter 9 - 

Sonar

x

Grids and Cartesian Coordinatesx
Negative Numbersx
Changing the Signsx
Absolute Valuesx
Coordinate System of a Computer Monitorx
Source Codex
Designing the Programx
The remove() List Methodx

Chapter 10 - 

Caesar Cipher

x

About Cryptographyx
ASCII, and Using Numbers for Lettersx
The chr() and ord() Functionsx
Source Codex
The isalpha() String Methodx
The isupper() and islower() String Methodsx
Cryptanalysisx
Brute Forcex

Chapter 11 - 

Othello

x

How to Play Othellox
Source Codex
The bool() Functionx
The random.shuffle() Functionx
Tips for Inventing Your Own Gamesx

Chapter 12 - 

AI Simulation

x

"Computer vs. Computer" Gamesx
Percentagesx
Integer Divisionx
The round() Functionx
Learning New Things by Running Simulation Experimentsx