How to return (a varying number of) objects with their original name in a function in Python
<p>I'm very new to Python. I'm looking to return a varying number of objects (will eventually be <code>lists</code> or <code>pandas</code>), ideally with their original name.</p>

<p>So far I'm looking at something like this:</p>

<pre><code>def function(*Args):
    Args = list(Args)    
    for i in range(len(Args)):
        Args[i] += 1
        print Args[i]
    return *all variables with original name, in this case a, b, c, d *

a=1
b=2
c=3
d=4

a, b, c, d = function(a, b, c, d)
</code></pre>

<p>Any help, ideas or comments would be very appreciated. Thanks.</p>

<p>Are you just looking to return the tuple?</p>

<pre><code>def function(*Args):
    Args = list(Args)    
    for i in range(len(Args)):
        Args[i] += 1
        print Args[i]
    return Args

 a, b, c, d = function(a, b, c, d)
</code></pre>

python args