Chapter 2

Python, Git & Package Management

Python interpreterpipGitvirtual environments

Learning Path

Hands-on Labs

Each objective has a coding lab that opens in VS Code in your browser

Objective 1

Install and verify Python

Goal

You will install Python and verify the installation is working correctly. Learn to check Python version, create isolated virtual environments using venv, and activate them for project-specific dependencies.

Objective 2

Write hello world script

Goal

You will write your first Python script and run it. Create a simple hello_agent.py file, run it from the terminal, and also run it using VS Code's integrated features.

Objective 3

Use Python REPL

Goal

You will learn to use the Python REPL (Read-Eval-Print Loop) for interactive experimentation. Start the interpreter, execute expressions to see immediate results, and exit properly.

Objective 4

Initialize Git repository

Goal

You will learn basic Git version control. Initialize a Git repository in your project folder, create a .gitignore file to exclude unnecessary files, and make your first commit to save your code.

Objective 5

Track changes with Git

Goal

You will learn the Git workflow for tracking code changes. Stage files with git add, commit changes with descriptive messages, and view your commit history with git log.

Objective 6

Install packages with pip

Goal

You will learn to install Python packages using pip. Install packages from PyPI, list installed packages, and create a requirements.txt file to document your dependencies.