I can perform
a = [1,2,3]
b = [4,5,6]
a.extend(b)
# a is now [1,2,3,4,5,6]
Is there way to perform an action for extending list and adding new items to the beginning of the list?
Like this
a = [1,2,3]
b = [4,5,6]
a.someaction(b)
# a is now [4,5,6,1,2,3]
I use version 2.7.5, if it is important.
b.extend(a)
? – Originatea
is calledvery_important
andb
is calledaux
. You may want to keep the former and forget about the latter. – Diagnostician