x = { " apple " , " banana " , " cherry " } y = { " google " , " microsoft " , " apple " } z = x . difference ( y ) print ( z )

输出结果为:

{'cherry', 'banana'}