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
.Premium
Python
Setting up Python environment...
Output