I'm just learning python and confused when a "def" of a function ends?
I see code samples like:
def myfunc(a=4,b=6):
sum = a + b
return sum
myfunc()
I know it doesn't end because of the return (because I've seen if statements... if FOO than return BAR, else return FOOBAR). How does Python know this isn't a recursive function that calls itself? When the function runs does it just keep going through the program until it finds a return? That'd lead to some interesting errors.
Thanks