Skip to main content
  • Python is available now. All other compilers are coming soon.

    Python
  • Popular Tutorials

    • Getting Started With Python
    • Python if Statement
    • while Loop in Python
    • Python Lists
    • Dictionaries in Python
    All Python Tutorials

    Reference Materials

    Built-in FunctionsList MethodsDictionary MethodsString Methods
    View all

Online Compilers

  • Python Compiler
  • Python Playground
  • Python Projects
  • Exercises

Tutorials

  • Learn Python
  • Python for Beginners
  • Variables and Types
  • Python Strings
  • Python Lists
  • Python If Else
  • Python For Loops
  • Python Functions
  • Python Classes

Examples

  • Python Examples
  • Hello World
  • Add Two Numbers
  • Even or Odd
  • Factorial
  • Fibonacci
  • Prime Check
  • Palindrome Check

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Use
  • Disclaimer

© 2026 ILoveCompiler. All rights reserved.

  1. Home
  2. Python Tutorial

Structured Python course

Learn Python step by step

A free, structured path from your first print() call to classes and error handling. Every lesson includes runnable code, clear explanations, and a link to the browser compiler.

Start with the introductionOpen the compiler
Tutorials
23
Modules
7
Reading time
≈ 3 hours

Course modules

  1. Getting started3
  2. Core Python5
  3. Control flow5
  4. Data structures5
  5. Functions3
  6. Object-oriented Python1
  7. Working with Python1

Suggested pace

One or two lessons per sitting, with time to run the examples. Prerequisites are listed on each lesson.

Getting started

Set up your mental model and run your first programs.

01beginner

Python Introduction: What Python Is and How to Run It

Learn what Python is, why it is popular, and how to run your first Python program directly in your browser with ILoveCompiler.

7 min read·3 learning goals
02beginner

Python print() and Comments

Learn how to display text and values with print(), control separators and line endings, and document code with comments.

6 min read·3 learning goals
07beginner

Reading User Input with Python input()

Read text and numbers from standard input, understand prompts, and design programs that handle supplied input cleanly.

7 min read·3 learning goals

Core Python

Numbers, strings, types, and the values you use every day.

03beginner

Python Variables and Data Types

Understand variables, assignment, dynamic typing, and the core built-in types: str, int, float, bool, and None.

8 min read·4 learning goals
04beginner

Python Numbers and Arithmetic Operators

Work with integers and floats, use arithmetic operators, understand precedence, and avoid floating-point surprises.

9 min read·4 learning goals
05beginner

Python Strings: Creation, Indexing, and Slicing

Create strings, access characters, take slices, use escapes, and explore common string operations.

9 min read·4 learning goals
06beginner

Python Type Conversion and Input Values

Convert between strings, integers, and floats safely, and understand which conversions can fail.

7 min read·3 learning goals
08beginner

Python Booleans and Comparison Operators

Use True and False, comparison operators, and logical operators to build conditions.

6 min read·3 learning goals

Control flow

Make decisions and repeat work with conditions and loops.

09beginner

Python if, elif, and else Statements

Control program flow with conditions, nested branches, and clear boolean expressions.

8 min read·3 learning goals
10beginner

Python while Loops

Repeat code until a condition changes, avoid infinite loops, and use counters and sentinels safely.

8 min read·3 learning goals
11beginner

Python for Loops

Iterate over strings, lists, ranges, and other iterables with Python's for loop.

8 min read·3 learning goals
12beginner

Python range() and enumerate()

Generate number sequences with range and track positions with enumerate while iterating.

7 min read·3 learning goals
13beginner

Python break, continue, and Loop else

Control loop execution with break and continue, and learn how the rarely used loop else clause works.

6 min read·3 learning goals

Data structures

Store and organise data with lists, tuples, dictionaries, and sets.

14beginner

Python Lists: Creation, Indexing, and Iteration

Store ordered collections in lists, access items by position, iterate over them, and use slicing and unpacking.

9 min read·4 learning goals
15beginner

Python List Methods: append, insert, remove, sort, and More

Modify lists with append, extend, insert, remove, pop, sort, reverse, and understand which methods return None.

8 min read·3 learning goals
16beginner

Python Tuples: Immutable Sequences and Unpacking

Use tuples for fixed groups of values, unpack them cleanly, and know when a tuple is a better choice than a list.

7 min read·4 learning goals
17beginner

Python Dictionaries: Keys, Values, and Practical Patterns

Store and retrieve key-value data with dictionaries, iterate over items, and use get, update, and comprehensions.

9 min read·4 learning goals
18beginner

Python Sets: Unique Values and Set Operations

Remove duplicates with sets, test membership quickly, and use union, intersection, difference, and symmetric difference.

8 min read·4 learning goals

Functions

Package logic into reusable, testable functions.

19beginner

Python Functions: Define, Call, and Return Values

Write reusable code with def, pass arguments, return results, and use docstrings to document behaviour.

9 min read·4 learning goals
20intermediate

Python Function Arguments: Defaults, Keyword, and *args

Use positional and keyword arguments, default values, *args, **kwargs, and avoid mutable default pitfalls.

9 min read·4 learning goals
21intermediate

Python Variable Scope and Object Lifetime

Understand local, global, and nonlocal scope, when variables are created, and why modifying globals inside functions is risky.

8 min read·4 learning goals

Object-oriented Python

Model state and behaviour with classes and objects.

23intermediate

Python Classes and Objects: A Practical Introduction

Define classes, create objects, use __init__ and methods, and model state without overengineering.

10 min read·4 learning goals

Working with Python

Handle errors and work confidently with real programs.

22intermediate

Python Error Handling with try, except, else, and finally

Read tracebacks, catch specific exceptions, raise your own errors, and clean up resources reliably.

9 min read·4 learning goals

Keep practising after the course

Reading is only part of learning. Work through exercises with automatic tests, study complete example programs, and build one of the guided projects.

Practice exercisesBrowse examplesStart a project