Ask Your Question

unpacking list in a list

asked 2018-01-11 15:16:35 -0600

anonymous user


Hi, I'm trying to convert a sympy code to sage.

I have found that the following does not work:

sector1 = [1,2,3]
sector2 = [4,5,6]
newlist = [*sector1, sector2]

even though the unpacking works for functions (ex F(*sector1)).

How do I do that?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-01-11 15:21:43 -0600

vdelecroix gravatar image

You should learn about Python lists

sage: sector1 + sector2
[1, 2, 3, 4, 5, 6]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-01-11 15:16:35 -0600

Seen: 20 times

Last updated: Jan 11