Source Code

Download

Download the source code for all the programs in one zip file here.

Or you can download the individual Python files for each program. To download, right-click these links and select "Save Target As...":

Chapter 1 - Installing Python(No programs in this chapter.)
Chapter 2 - The Interactive Shell(No programs in this chapter.)
Chapter 3 - Stringshello.py
Chapter 4 - Guess the Numberguess.py
Chapter 5 - Jokesjokes.py
Chapter 6 - Dragon Realmdragon.py
Chapter 7 - Flow Charts(No programs in this chapter.)
Chapter 8 - Hangmanhangman.py
Chapter 9 - Tic Tac Toetictactoe.py
Chapter 10 - Bagelsbagels.py
Chapter 11 - Cartesian Coordinates(No programs in this chapter.)
Chapter 12 - Sonarsonar.py
Chapter 13 - Caesar Ciphercipher.py
Chapter 14 - Reversireversi.py
Chapter 15 - AI SimulationAISim1.py
AISim2.py
AISim3.py
Chapter 16 - Graphics and Animationanimation.py
pygameHelloWorld.py
Chapter 17 - Collision Detection and InputcollisionDetection.py
pygameInput.py
Chapter 18 - Sound and ImagesspritesAndSounds.py
Chapter 19 - Dodgerdodger.py

Copy and Paste

If you don't want to download the files, you can select the program you want from this dropdown menu and copy & paste the source code from the text area below.

First, click inside the text field. Then press Ctrl-A to Select All, then press Ctrl-C to Copy the selected text. Then paste the text into IDLE or your text editor.