摘要: #Create a set seta = set([5, 10, 3, 15, 2, 20]) #Find maximum value print(max(seta)) #Find minimum value print(min(seta)) 阅读全文
posted @ 2018-11-13 10:26 anobscureretreat 阅读(3995) 评论(0) 推荐(0)
摘要: #Intersection setx = set(["green", "blue"]) sety = set(["blue", "yellow"]) setz = setx & sety print(setz) 阅读全文
posted @ 2018-11-13 10:22 anobscureretreat 阅读(308) 评论(0) 推荐(0)
摘要: #Union setx = set(["green", "blue"]) sety = set(["blue", "yellow"]) seta = setx | sety print(seta) 阅读全文
posted @ 2018-11-13 10:20 anobscureretreat 阅读(230) 评论(0) 推荐(0)
摘要: setx = set(["apple", "mango"]) sety = set(["mango", "orange"]) #Symmetric difference setc = setx ^ sety print(setc) 阅读全文
posted @ 2018-11-13 10:17 anobscureretreat 阅读(344) 评论(0) 推荐(0)