Run
# Take two sets set_1 = {'a', 'b', 'c', 'd'} set_2 = {'a', 'k', 'd', 'm'} print(f"set_1 before update : {set_1}") # Intersection Update set_1 set_1.intersection_update(set_2) print(f"set_1 after update : {set_1}")
Output