Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 425 Bytes

File metadata and controls

21 lines (15 loc) · 425 Bytes

set

  • set 자료구조는 중복되는 데이터를 포함하지 않는다
my_set = {1,1,1,2,'e','e',2,3,3,3,3,3,3}

my_set # output: {1,2,3,'e'}
  • set 기반의 list 중복제거 방법
def remove_duplicates(input_list):
  if len(input_list) == len(set(input_list)):
    return "No duplicates"
    
  clean_list = list(set(input_list))
  return clean_list

remove_duplicates([1,2,3,4,4,5])