Encapsulate Existing Function

In the code below, my_func repeatedly calls inner_func. Although the code runs without any issues, inner_func is currently defined as a global function. Adjust the code so that inner_func is nested inside my_func.
def inner_func(): print('Hello World') def my_func():
for _ in range(3): inner_func() my_func()
Python
Setting up Python environment...
Output