** * This article is from Udemy "[Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style](https://www.udemy.com/course/python-beginner/" Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style ")" It is a class notebook for myself after taking the course of. It is open to the public with permission from the instructor Jun Sakai. ** **
inner_function
def outer(a, b):
def plus(c, d):
return c + d
r = plus(a, b)
print(r)
outer(1, 2)
result
3
It is also possible to define newer functions within the function.
If you don't use the inner function (plus
) anywhere other than the outer function (ʻouter`)
It is good to describe it as an in-function function.
Recommended Posts