python每日練習

""" 習題 1:一個列表,排重,不能用 set,也不能用字典 """ #方法一1:循環、遍歷 l = [1,1,1,2,2,3,4,4,6] new_l = [] for i in l: if i not in new_l: new_l.append(i) print(new_l) #方法2:set l = [1,1,1,2,2,3,4,5,5] result = l
相關文章
相關標籤/搜索