python set用法小結

1.建立集合 set()html >>>set('python') {'o', 'p', 'h', 'n', 't', 'y'} >>>set(['python']) {'python'} #去重 >>>list1 = [11, 11, 12, 13, 14, 14, 15] >>>set(list1) {11, 12, 13, 14, 15} 2.添加 add(),update()java #
相關文章
相關標籤/搜索