Returning Functions From Functions
This lesson covers how to return functions from functions.
The code example in the lesson uses a function called
parent() that contains two inner functions that return a string of text:
def parent(num): def first_child(): return "Hi, I am Emma" def second_child(): return "Call me Liam" if num == 1: return first_child else: return second_child
You’ll see how to access these inner functions and assign them to variables.
Comments & Discussion
Become a Member to join the conversation.