p
y
c
h
a
l
l
e
n
g
e
r
Home
Intermediate Python
Functions II
Create Nested Function
Create Nested Function
In the code below,
my_func
repeatedly calls the function
inner
. However, that function hasn't been created yet. Define the
inner
function and make it print a message each time it's called.
Premium
reset
def my_func():
for _ in range(5): inner() my_func()
Python
Setting up Python environment...
Output