python
Published on January 26, 2024By DeveloperBreeze
# Define two lists
list1 = [1, 2, 3, 4, 5]
list2 = [3, 4, 5, 6, 7]
# Find common elements using set intersection
common_elements = list(set(list1) & set(list2))
# Define two lists
list1 = [1, 2, 3, 4, 5]
list2 = [3, 4, 5, 6, 7]
# Find common elements using set intersection
common_elements = list(set(list1) & set(list2))
Comments
Please log in to leave a comment.