JS去重 + Python去重
1 var arr1 = [1,2,3,3,4,4,5,6], 2 arr2 = []; 3 for(var i=0; i < arr1.length; i++){ 4 if(arr2.indexof(arr1[i]) < 0{ 5 arr2.push(arr1[i]); 6 } 7 } 8 9 document.write(arr2);
l1 = []
l2 = list(set(l1))
卡卡,你好吗
1 var arr1 = [1,2,3,3,4,4,5,6], 2 arr2 = []; 3 for(var i=0; i < arr1.length; i++){ 4 if(arr2.indexof(arr1[i]) < 0{ 5 arr2.push(arr1[i]); 6 } 7 } 8 9 document.write(arr2);
l1 = []
l2 = list(set(l1))