On Wed, Jun 3, 2015 at 7:27 AM, fl <rxjw...@gmail.com> wrote: > I just see the tutorial says Python can return value in function, it does > not say multiple data results return situation. In C, it is possible. > How about Python on a multiple data return requirement?
Technically, neither C nor Python can return multiple values from a single function call. In Python, the most common way to do this is to return a tuple, which can then be unpacked; as other posts in this thread have shown, this can look a lot like returning multiple values, and it's pretty convenient. In C, the nearest equivalent is passing a number of pointers as parameters, and having the function fill out values. Python's model is a lot closer to what you're saying than C's model is :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list