Creating Inner Functions in Python

preview_player
Показать описание
Python allows the declaration of functions inside other functions. The inner functions, also known as nested functions, are defined within a function. This type of function has direct access to variables and names defined in the enclosing function in Python.

Рекомендации по теме
Комментарии
Автор

I was looking for an video to learn inner functions(nested functions), but this video used many complicated content like raise, with as, is instance that I don't know about it and you don't explain about them in this video

shokintouch
Автор

I can't help but be uncomfortable with nesting function definitions. It "feels" like additional overhead (Idak if it really is). Maybe in JavaScript I can digest the thought better.

The first thing I thought of in the CSV example was that I'd put them all in a class, to imply that they are related functions... But maybe that's additional overhead too 😅

re.liable