I have a hello
function and it takes n arguments (see below code).
def hello(*args):
# return values
I want to return multiple values from *args
. How to do it? For example:
d, e, f = hello(a, b, c)
SOLUTION:
def hello(*args):
values = {} # values
rst = [] # result
for arg in args:
rst.append(values[arg])
return rst
a, b, c = hello('d', 'e', f)
a, b = hello('d', 'f')
Just return list. :) :D