Write a program to keep only the items that are present in both sets


Topic: Write a program to keep only the items that are present in both sets

Solution

x = {"apple", "banana", "cherry"}
y = {"google", "microsoft", "apple"}
x.intersection_update(y)
print(f"Duplicate Value in Two set:{x}")



List all Python Programs