This repository contains example programs from Tony Gaddis' book Starting Out with Python. The examples are organized by chapter and demonstrate key programming concepts step by step, making it easier to learn the foundations of Python.
The examples are grouped by chapter, following the structure of the book:
Programming_Foundations_Examples/
├── Chapter 02/ # Variables, input, output, basic math
├── Chapter 03/ # Decision structures (if/else)
├── Chapter 04/ # Loops and repetition structures
├── Chapter 05/ # Functions
├── Chapter 06/ # Files and exceptions
├── Chapter 07/ # Lists and tuples
├── Chapter 08/ # More about strings
├── Chapter 09/ # Dictionaries and sets
├── Chapter 10/ # Classes and object-oriented programming
...
Each folder contains small, focused .py
scripts such as:
simple_math.py
loan_qualifier.py
for_loop_with_break.py
commission.py
test_score_average.py
These scripts are designed to be short and self-contained, so learners can run and modify them easily.
- Python 3.8+ (any recent version should work)
- (Optional) A virtual environment if you want to install additional dependencies
Clone this repository and run any example with:
python Chapter\ 02/simple_math.py
Or from inside the folder:
cd "Chapter 02"
python simple_math.py
These examples are intended for:
- Students following along with the book
- Beginners learning programming foundations in Python
- Instructors needing small teaching examples
- T. Gaddis, Starting Out with Python, Pearson Education.
This repository is primarily for educational purposes, but feel free to:
- Suggest improvements
- Add comments or explanations
- Expand with new exercises
This repository is for educational and personal use only. Example programs are adapted from the book and provided here as learning material.