Skip to content

acroynon/Python-An-Introduction-to-Code-Source-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python: An Introduction to Code — Source Code

Python: An Introduction to Code - Physical Book and Code

Welcome to the official code repository for Python: An Introduction to Code by Adam Roynon.

This 484-page guide is built on the principle of "Learning by Code." This repository contains all the examples, activity solutions, and extra challenges featured in the book.


About the Book

Python: An Introduction to Code takes you on a journey from your first "Hello World" to the complex inner workings of computer science. It bridges the gap between basic scripting and professional software development.

Key Topics Covered:

  • Foundations: Variables, Collection Types (Lists, Sets, Tuples, Dictionaries), and Logic.
  • Systems: Exception Handling, File I/O, and Serialization.
  • Object-Oriented Programming: Classes, Inheritance, and Method Resolution Order (MRO).
  • GUI Development: Building visual desktop applications with Tkinter and Turtle.
  • Computer Science Theory: A deep dive into Compilers vs. Interpreters, Memory Management (Heap vs. Stack), and Garbage Collection.

The Extra Challenges

The final section of the book removes the "safety net." These projects provide Project Briefs—logic and functional requirements without the code—to simulate real-world development. This repository contains the reference solutions for:

  • ♠️ Blackjack (21): A full game engine including Dealer AI behavior, "Bust" logic, and a bonus challenge to model a realistic, shuffled 52-card deck.
  • 🧮 Functional Calculator: A capstone project bridging the gap between back-end logic and GUI design using the Tkinter library.
  • 🔐 Caesar Cipher: An introduction to cryptography. Build a tool to encrypt and decrypt messages using character-shifting and wrap-around logic.
  • 🔄 Palindrome Checker: A test of string manipulation, slicing, and RegEx to identify phrases that read the same backwards and forwards.
  • ✊ Rock Paper Scissors: A game that tracks state (wins/losses/draws) and uses the random library for computer decision-making.
  • 🔢 Fibonacci Sequence: A mathematical challenge to calculate N numbers of the sequence using efficient loops.

How to Use This Repo

You can access the code in two ways:

Option 1: For Beginners (No Git Required)

  1. Click the green "Code" button at the top of this page.
  2. Select "Download ZIP".
  3. Extract the folder to your computer. You now have all the Python files ready to open in your editor.

Option 2: Using Git

  1. Clone the repo: git clone https://github.com/YOUR_USERNAME/python-introduction-by-code.git
  2. Navigate to a chapter: e.g., cd chapter-22-oop
  3. Run a script: python 01-basic-class.py

Get the full 480+ page explanation: Buy the book on Amazon

About

This repository contains all the examples, activity solutions, and extra challenges featured in the book.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages