Indicia - Introduction to Python

5-day intensive training course

Course aim

This 5-day Python course is designed for developers, engineers, and professionals with programming experience who want to become confident in reading, writing, and working with Python code. The course progresses from Python fundamentals through to advanced topics including HTTP communication, database access, and testing.

We start with environment setup, syntax, data types, and flow control, and progress through functions, object-oriented programming, error handling, modules, file handling, and modern Python practices. The course emphasizes hands-on learning with real-world scenarios and practical labs.

Each section is accompanied by slides, sample code, interactive labs, and complete solutions. As a live course, we can go deeper on topics of interest, whether or not they're explicitly on the syllabus.

Course materials

Labs are released in batches. Download the batch you need below; slides and code samples are added as they become available.

Labs (by batch)

Slides (by batch)

Code samples

Complete code written during the course (all 5 days).

Daily schedule

5-day intensive course:

  • 09:30-11:00 — Session 1
  • 11:00-11:20 — Break
  • 11:20-12:45 — Session 2
  • 12:45-13:45 — Lunch
  • 13:45-15:10 — Session 3
  • 15:10-15:30 — Break
  • 15:30-16:30 — Session 4

Day 1: Python Fundamentals

Getting Started with Python

  • Using the Interactive Interpreter (REPL)
  • Setting up Python virtual environments
  • Using an Integrated Development Environment (IDE)
  • Python execution model
  • Running programs
Lab 1: Environment Setup — Configure your Python development environment with virtual environments and IDE setup.

Python Language Fundamentals

  • Overview of core Python syntax
  • Identifiers and reserved words
  • Data types and variables
  • Type conversion (int(), float(), str())
  • Arithmetic and assignment operations
  • Strings, Numbers, and None
Lab 2: Interactive Input — Build a customer registration system using input(), type conversion, and string formatting.

Flow Control

  • if, elif, else statements
  • Comparison and logical operators
  • Ternary expressions
  • while loops
  • for loops
  • break, continue, and else clauses
Lab 3: Iteration and Control — Create an interactive number guessing game using loops and conditional logic.

Day 2: Data Structures and Collections

Data Containers

  • Python collection types overview
  • Tuples
  • Lists
  • Collection constructors
  • Membership testing
  • Iteration over collections
Lab 4: Containers — Enhance the guessing game with history tracking using lists and tuples.

Advanced Data Containers

  • Sets and FrozenSets
  • Dictionaries
  • Dictionary operations (.get(), .items(), .keys(), .values())
  • List comprehensions
  • Set and dictionary comprehensions
Lab 5: Dictionaries — Add score tracking to the guessing game using dictionaries.

Day 3: Functions and Advanced Programming

Working with Functions

  • Writing and calling functions
  • Passing parameters
  • Positional and keyword arguments
  • Default parameter values
  • Returning values
  • Returning multiple values
  • Function scope and namespaces
Lab 6: Functions — Refactor code into reusable functions for an e-commerce pricing system.

Higher-Order Functions

  • Lambda functions
  • map(), filter(), and reduce()
  • Function composition
  • Decorator syntax overview
Lab 7: Higher-Order Functions — Process news articles using functional programming techniques.

Classes and Object-Oriented Programming

  • Everything is an object in Python
  • Class terminology
  • Defining and instantiating classes
  • Instance variables and methods
  • __init__ and __str__ methods
  • Classes and inheritance
  • Method overriding
  • Extending built-ins
  • Accessors and mutators (@property)
  • Composition vs. inheritance
Lab 8: Classes — Build an order management system using object-oriented programming.

Day 4: Error Handling, Modules, and File Operations

Exception Handling

  • Errors and exceptions
  • try, except, finally blocks
  • Raising exceptions
  • Custom exceptions
  • Exception hierarchies
Lab 9: Exceptions — Implement robust error handling in a financial transaction processing system.

Packages, Programs, and Modules

  • Python architectural approaches
  • Defining modules and packages
  • import statements
  • Module properties (__name__, __file__)
  • The if __name__ == "__main__" pattern
  • The Python Standard Library
  • Using pip to install packages
  • requirements.txt files
Lab 10: Modules — Create a modular analytics package with reusable components.

File Handling

  • Overview of file handling in Python
  • Reading and writing text files
  • Structured text files (CSV, JSON)
  • Working with binary files
  • Streaming and serializing Python objects (pickle, json)
  • Context managers (with statements)
Lab 11: Files — Work with various file formats and data serialization.

Day 5: Testing, HTTP, and Database Access

Introduction to Testing

  • Approaches to unit testing
  • Test-driven development (TDD)
  • Python testing tools (pytest)
  • Writing tests
  • Assertions
  • Fixtures
  • Parameterizing tests
  • Testing for exceptions
Lab 12: Testing — Leverage automated testing to build confidence in your code.

Accessing HTTP Endpoints

  • Implementing web services using Python
  • Making HTTP requests (requests library)
  • Dealing with URL parameters
  • Common data transfer structures (JSON)
  • Handling HTTP errors and status codes
  • Parsing API responses
Lab 13: HTTP Endpoints — Build a news API client to fetch and process data from web services.

Database Access

  • Configuring database access
  • Connecting to databases (SQLite)
  • Making SQL requests
  • Parameterized queries
  • Handling data responses
  • Transaction management
Lab 14: Database Access — Create a customer database system with SQLite.

Lab structure and pedagogy

All labs follow a consistent structure:

  1. Objective — Clear learning goals for the lab
  2. Scenario — Real-world context for the exercise
  3. Tasks — Step-by-step tasks with "Your task", "Hints", and collapsible solution sections

This approach encourages you to think through problems before seeing solutions, learn by doing, check your work when needed, and build confidence through guided discovery.

What's included

  • Labs — HTML format with collapsible solutions; real-world scenarios; progressive difficulty; complete solutions in labs-solutions/
  • Slides — Decks per topic with code examples and visual explanations
  • Sample code — Working, commented examples and multiple approaches
  • Solutions — Tested solution files for all labs

Learning outcomes

By the end of the course you will be able to:

  • ✅ Set up a professional Python development environment
  • ✅ Write Python programs using core syntax and data types
  • ✅ Use control flow structures effectively
  • ✅ Work with collections (lists, tuples, sets, dictionaries)
  • ✅ Write and use functions with various parameter types
  • ✅ Create classes and use object-oriented programming
  • ✅ Handle errors and exceptions gracefully
  • ✅ Organize code into modules and packages
  • ✅ Read and write files in various formats
  • ✅ Write and run automated tests
  • ✅ Make HTTP requests and work with APIs
  • ✅ Connect to databases and execute queries

Prerequisites

  • Programming experience in at least one other language
  • Basic computer skills (file management, text editing)
  • No prior Python knowledge required

Course delivery

  • Format: Live, instructor-led training
  • Hands-on: Extensive lab work with real-world scenarios
  • Interactive: Questions and deeper dives encouraged
  • Materials: All labs, slides, and solutions provided

Getting started

  1. Set up your environment — Follow Lab 1 to configure Python, virtual environments, and your IDE
  2. Work through labs sequentially — Each lab builds on previous concepts
  3. Try before looking — Attempt each task before checking the solution
  4. Experiment — Modify code and see what happens
  5. Ask questions — Use the interactive format to dive deeper into topics

Additional resources