<bhk755 <at> gmail.com> writes: > > Thanks for the reply Chris. > > I am newbie to python, so please excuse me if I am asking chilly questions. > > Can you please explain more about the following sentence. > "When it says "Splitting" with a single-element list, it then > immediately prints "Merging" and returns (because all the rest of the > code is guarded by the 'if'). Execution then continues where it left > off, in the parent." > > Because I am not sure how the control can go back to top of the function unless there is no loops there. >
It doesn't. The function simply returns and execution resumes in the parent, i.e. in the calling function at depth-1, where it left off. In Python, a return None is implied when a function falls off its end. > Also, Can you please let me know how did you found out that I am using Python 2 Interpreter. print as a statement (without parentheses) only works in Python 2, in Python 3 print is a function. > > Bharath > > -- http://mail.python.org/mailman/listinfo/python-list