Generation

generate functionSun, 13 Nov 2022

Given two lists as inputs, find all matching elements within each list and return as its own list

def intersect(a, b): return list(set(a) & set(b)) intersect([1, 2, 3], [2, 3, 4])

Questions about programming?Chat with your personal AI assistant