Click to view the other books

Source Code

Download

Zip file of source code for all programs.

Chapter 3, Strings
hello.py
Chapter 4, Guess the Number
guess.py
Chapter 5, Jokes
jokes.py
Chapter 6, Dragon Realm
dragon.py
Chapter 9, Hangman
hangman.py
Chapter 10, Tic Tac Toe
tictactoe.py
Chapter 11, Bagels
bagels.py
Chapter 13, Sonar
sonar.py
Chapter 14, Caesar Cipher
cipher.py
Chapter 15, Reversi
reversi.py
Chapter 16, AI Simulation
AISim1.py
AISim2.py
AISim3.py
Chapter 17, Graphics and Animation
pygameHelloWorld.py
animation.py
Chapter 18, Collision Detection and Input
collisionDetection.py
pygameInput.py
Chapter 19, Sound and Images
spritesAndSounds.py [graphics files]
Chapter 20, Dodger
dodger.py [graphics files]

Copy and Paste

You can also select the text of the source code below, and copy & paste the code into IDLE.

(Click on the text field, then press Ctrl-C to copy.)

You can also download the Python 2 version of the programs in this book.