a = {‘one’, ‘two’} b = {‘two’, ‘three’} print(a – b)
The code you provided is performing a set operation in Python. Specifically, it’s finding the set difference between sets a and b, denoted by a - b.
In Python, the - operator when applied to sets returns the elements that are in the first set (a) but not in the second set (b).
So, when you execute print(a - b), it will output the elements that are in set a but not in set b.
In this case, the output will be {'one'}, because 'one’ is in set a but not in set b.
If you run the code, you will see {'one'} printed as the result.

ディスカッション
コメント一覧
まだ、コメントがありません