Learning Python with Advent of Code Walkthroughs

Dazbo's Advent of Code solutions, written in Python

The Python Journey - Getting Started with Python

Argand Plot

›

Useful Links

Python Beginner's GuideThe Python HandbookThe Official Python TutorialGetting started with Python in VS Code TutorialGituv (Python Package Manager)Virtual EnvironmentConda

If you’re new to Python, then you’ll want to start here. If you’re already comfortable using Python, then feel free to dive straight into the AoC walkthroughs, using the links above.

Why Python?

If you’re a newbie to programming, then Python is a great language to start with. If you have a lot of programming experience, then guess what? Python is an amazing language to learn, and you’ll love it.

Many years ago, I used to write software for a living. Back then, my preferred languages were Java and C#. These days, I don’t write code in my job, though I do still need to know my way around. Now I write code as a hobby. But I can honestly say: of all the programming languages I’ve ever used, Python is my favourite.

For those of you coming from a background with languages like C, C#, Java, Javascript… You may find Python’s syntax and structure a bit jarring. But trust me: once you get your head around the differences, you’ll love it, just like I do.

Here are some of Python’s strengths:

My Recommendations for Getting Started

I recommend working through the following, to get started:

  1. Install Python 3.13+
  2. Get a development environment / editor
  3. Get Git
  4. Learn the Python basics
  5. Environments & Packages with uv (or standard venv / Conda)

Getting and Installing Python

To execute Python programs, you need a recent Python runtime installed (Python 3.13+ is recommended for this repository). To check what you have installed, open your terminal and run:

> python --version

If you get a response that shows you have Python 3.13+ installed, then you’re good to go. (Alternatively, uv can download and manage isolated Python versions for you automatically!) E.g.

Verify Python Installation

If you haven’t got Python installed, download the latest Python 3.13+ release from python.org, or install it via uv python install 3.13. Take a look here if you need additional guidance.

Development Environment / Editor

You can write and run Python programs without a development environment. But it’s a much better - and more effective - experience, if you have one.

A development environment adds a wealth of features, such as:

Visual Studio Code

My favourite development environment is Visual Studio Code - aka VS Code - which can be downloaded and installed from here. (Note: VS Code is not the same as Visual Studio, which is a different product.)

Some benefits of VS Code:

Visual Studio Code

Installing and Setting Up VS Code

Check out the following useful links:

Install Useful Extensions

Now you’ll want to install some extensions that will make your Python - and general development - experience better. In VS Code, click on the Extensions button in the left hand panel of buttons. I’d recommend installing the following:

Note: if you’ve followed the Getting started with Python in VS Code Tutorial, this will have guided you through installing some of these extensions.

Git

Git is an extremely popular version control system (VCS). A VCS provides capabilities like these:

So Why Git?

Git is an open source VCS, created by the legendary Linus Torvalds. You know… The guy that created Linux.

Git is:

Installing Git

Python Basics

Finally, if you’re completely new to Python, you might want to learn some basics before you begin with AoC. Here’s a list of some decent learning material to help you get started:

This repository uses uv with pyproject.toml and uv.lock to manage the Python 3.13+ runtime, virtual environment (.venv/), and dependencies cleanly in one step:

# Create .venv/ and install all solution, dev, and Jupyter dependencies
uv sync --dev --extra jupyter   # or: make install

# Run any solution script directly inside .venv/ (no manual activation needed)
uv run python src/AoC_2025/d01/d01.py

# Launch JupyterLab for notebook solutions
uv run jupyter lab

VS Code will automatically detect .venv/ once created.

Python Virtual Environments

Under the hood, tools like uv still use a standard virtual environment (venv) — an isolated Python context per project so package versions never conflict across projects or with your operating system.

Always work inside a project virtual environment rather than installing packages globally.

If you prefer creating a virtual environment with Python’s built-in venv module instead of uv:

# Create .venv/ (never commit .venv/ to Git)
python -m venv .venv

# Activate it
source .venv/bin/activate        # Linux / macOS
.venv\Scripts\Activate.ps1       # Windows PowerShell

# Install packages
python -m pip install some-package

Using Conda

Conda is an alternative environment and package manager that can also bundle non-Python system libraries (such as ffmpeg or graphviz). For this repository, uv with pyproject.toml replaces our older Conda setup, though if you prefer Conda you can still create a Python 3.13+ environment with conda create -n aoc-env python=3.13.

›