OpenViSTAI · Agents · Blockchain · Crypto
Menu

OPENVIST LEARN · FREE LESSONS

Python foundations: from your first line to a tested CLI

Twenty-two practical beginner lessons: Python values, decisions, collections, functions, classes, files, JSON, CSV, command-line arguments and tests, ending with a small validated JSON reporting tool.

A terminal preview showing your first successful Python greeting.

What you will build

Learn to write and explain small Python programs, then combine them into a command-line report with validation and automated tests. Work locally or in a practice VPS; renting a server is optional.

The reference environment is Python 3.12 on Ubuntu 24.04. Source examples also use standard Python on macOS and Windows. Shell commands are labelled Bash; Windows users use the interpreter guidance in lesson 1. No external Python packages or paid API are needed.

Allow roughly 7–10 hours including exercises, and repeat topics at your own pace. Each Python code block is a complete example unless explicitly identified as a project file. The final project has source downloads, expected results and regression tests.

This is a complete foundations route, not the whole Python language: web frameworks, databases, concurrency, packaging for distribution and production deployment are later topics. Being able to predict, explain and test your result matters more than finishing quickly.

Your learning path

  1. LESSON 1 · 15 MIN

    Meet Python and run your first program

    Separate Python source from terminal commands, choose an interpreter and run a saved file.

    Open lesson →
  2. LESSON 2 · 20 MIN

    Names, values and readable programs

    Store values, reuse them and explain intent without hiding it in cryptic names.

    Open lesson →
  3. LESSON 3 · 20 MIN

    Numbers, types and conversion

    Work with integers and decimals while recognising that text containing digits is still text.

    Open lesson →
  4. LESSON 4 · 20 MIN

    Strings, slicing and clean display

    Read and transform text without confusing formatting with data validation.

    Open lesson →
  5. LESSON 5 · 20 MIN

    Read a value and check it

    Accept a small interactive input and handle a bad conversion with a useful message.

    Open lesson →
  6. LESSON 6 · 20 MIN

    Decisions with if, elif and else

    Express a rule as readable branches and understand indentation.

    Open lesson →
  7. LESSON 7 · 20 MIN

    Lists, tuples and shared values

    Keep related values together and see the difference between changing a list and copying it.

    Open lesson →
  8. LESSON 8 · 20 MIN

    Loops, counting and stopping

    Repeat work over a sequence without losing track of what changes each time.

    Open lesson →
  9. LESSON 9 · 20 MIN

    Dictionaries, sets and missing values

    Use names for fields, count categories and distinguish a missing key from a stored value.

    Open lesson →
  10. LESSON 10 · 20 MIN

    Transform collections without hiding the rule

    Build a new collection concisely and understand when an iterator is consumed.

    Open lesson →
  11. LESSON 11 · 20 MIN

    Functions, return values and scope

    Give a repeated rule a name, accept arguments and return a result you can test.

    Open lesson →
  12. LESSON 12 · 25 MIN

    Classes and simple data objects

    Group related state and behaviour without turning every function into a class.

    Open lesson →
  13. LESSON 13 · 20 MIN

    Errors, tracebacks and useful failures

    Find the failing operation and handle only errors you understand.

    Open lesson →
  14. LESSON 14 · 20 MIN

    Modules, imports and entry points

    Move a small rule into another file and keep imports from unexpectedly running your CLI.

    Open lesson →
  15. LESSON 15 · 20 MIN

    Paths and text files without accidental overwrites

    Read UTF-8 text, understand relative paths and create a new practice file deliberately.

    Open lesson →
  16. LESSON 16 · 25 MIN

    JSON and checking the shape of data

    Decode a JSON document and verify its structure before using fields.

    Open lesson →
  17. LESSON 17 · 20 MIN

    CSV rows, headers and quoted fields

    Read tabular text without splitting it incorrectly at every comma.

    Open lesson →
  18. LESSON 18 · 25 MIN

    Command-line arguments and exit codes

    Turn an interactive idea into a repeatable command with a help screen.

    Open lesson →
  19. LESSON 19 · 20 MIN

    Virtual environments and dependency choices

    Keep a project’s packages separate and recognise when no package installation is needed.

    Open lesson →
  20. LESSON 20 · 25 MIN

    Automated checks with unittest

    Turn expected behaviour into repeatable checks, including edge cases.

    Open lesson →
  21. LESSON 21 · 40 MIN

    Project: build a bounded JSON reporting tool

    Combine the earlier lessons into a useful local program with an explicit contract.

    Open lesson →
  22. LESSON 22 · 30 MIN

    Project: test failures and connect a real recipe

    Prove a small set of useful behaviours and decide what remains outside the tool’s scope.

    Open lesson →