Q:

Append part of result into list in python

There is some method, which output two variables, for example:
def some_method():
    #some calculations
    return first_value, second_value

Now I want to put in one line results into variable and list (put first_value to some variable and second_value add to list as a new element).
I know that I can do something like this:
def some_method(list):
    #some calculations
    return first_value, list+[second_value]

and then:
some_variable, list = some_method(list)

but is there any chance to do it in one line and without pass list as method argument?

A:

Can you return the second value in a list?
Like this:
>>> L = [1, 2, 3]
>>> def bar():
...     return 'shenanigan', [4]
... 
>>> myVar, L[len(L):] = bar()
>>> L
[1, 2, 3, 4]

really, though, you might as well assign the second return value to an intermediate variable and just use list.append(), using two lines.

