Nested functions in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Nested functions in python?

how can i use nested functions and the syntax example def outside (x): print (x) def inside(y): print (y) return inside(y) so how can i pass (y )to the second function from outside both functions ? and i know i can make another pramter in the outside function to hold y but this is not what im searching for i guess i need someone to explain the entire thing to me

19th Sep 2017, 4:28 PM
jay
1 Answer
+ 3
"so how can i pass (y )to the second function? " From...where? You could write "return inside(x)" but I can't tell what you want exactly. Note that print() does not return a value so your return will produce "None"
19th Sep 2017, 4:45 PM
Kirk Schafer
Kirk Schafer - avatar