num_set = {1, 2, 3, 4, 5} word_set = set(["spam", "eggs", "sausage"]) print(3 in num_set) print("spam" not in word_set)
结果:
>>> True False >>>
0