Print sets 1 and 2 after converting the lists to sets. With set1 being the list1 and set2 being the list2, set1&set2 yields the common items set.
The above method is implemented in Python 3 as follows:
# Python program to find the common elements
# in two lists
def common_member(a, b):
a_set = set(a)
b_set = set(b)
if (a_set & b_set):
print(a_set & b_set)
else:
print("No common elements")
a = [1, 2, 3, 4, 5]
b = [5, 6, 7, 8, 9]
common_member(a, b)
a = [1, 2, 3, 4, 5]
b = [6, 7, 8, 9]
common_member(a, b)
Learn more about implemented here-
https://brainly.com/question/16130761
#SPJ4