Skip to content
Klay

Functions, imports and modules

After this lesson you can: Split code into functions and import across files.

First: Python crash course

Watch

Notes

A function is a named chunk of code with inputs and an output. Instead of writing every step in one long file, you give repeated or meaningful work a name: load_data, clean_row, call_model, save_results. That name becomes part of your program’s vocabulary, which makes the code easier to read, test, debug, and reuse.

Unlock the full lesson notes, the exercises and the graded checkpoint - ₹5,000 once.