Q:

function that takes in and returns multiple values

Say I have a function that calculates and returns an value:
h = 4.13566733*10**-15
c = 2.99792458*10**(8+9)

def func(x):
    for i in w:
        A = h*c/i
    return A

w = [1]
print func(w)

Fine. But if w is a larger array, say:
w = [1 ,2, 3, 4]

The func returns for the last value in w (4). Understandebly as that is the last item in the for-loop.
But how can I make the func return an array with all 4 values, something like:
[1239, 619, 413, 309]

??

A:

Python supports passing multiple arguments, and returning multiple values. That said, you can change your code to:
def func(w):
    return [h*c/i for i in w]

If you now call this, you can get the required array:
>>> w = [1 ,2, 3, 4]
>>> func(w)
[1239.8418743309974, 619.9209371654987, 413.2806247769991, 309.96046858274934]

As for calling with multiple arguments and returning multiple examples, consider the following example method, which takes 2 inputs and returns 3 outputs:
>>> def get_product_modulo_dividend(x, y):
...     return x*y, x%y, x/y
>>> get_product_modulo_dividend(100, 10)
(1000, 0, 10)

