Defining Functions Inside Functions Python Return