0

Python

Can I embed a function inside another function in Python ? Like parent function and child function

9th Sep 2024, 7:28 PM
Faycal HADJI
Faycal HADJI - avatar
2 Réponses
+ 5
Faycal HADJI , as already said, we can have functions inside functions. here is a sample for calculating properties of a circle: https://sololearn.com/compiler-playground/c6F666Dh9nHv/?ref=app
9th Sep 2024, 8:18 PM
Lothar
Lothar - avatar
+ 3
Yes, but it's called "inner function" at every level Python also has the concept of "nonlocal" for something similar
9th Sep 2024, 8:12 PM
RuntimeTerror
RuntimeTerror - avatar