First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 8 years ago

sssageeee gravatar image

Finding intersection of two lists?

Hello, guys. First of all, I'm very new to Sage and also to this forum, so please be generous for my question...

So, suppose we have

c=[[0, 1, 2, 3], [0, 1, 2, 4], [0, 1, 3, 4], [0, 2, 3, 4], [1, 2, 3, 4]],

d=[[0, 1, 2, 3], [0, 1, 3, 4], [0, 2, 3, 4], [9, 8, 7, 6]]

I would like to get

[[0, 1, 2, 3], [0, 1, 3, 4], [0, 2, 3, 4]]

which is intersection of c and d. Is there a way to do this?

Thank you for any help.