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