티스토리 뷰

공부

[Python] unique list

승가비 2020. 4. 26. 02:22
728x90
ex_list = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'c', 'd' ] 
ex_list = list(set(ex_list))
print(ex_list)

# ['a', 'c', 'b', 'e', 'd', 'g', 'f']

https://bluese05.tistory.com/13

 

python list 값 중복 제거하기

Python 의 List 에 중복된 값이 있을 경우, 중복 제거를 하고 싶은 경우가 있다. 물론 직접 해당 기능을 구현할 수 있으나, 간단한 방법이 있다. 바로 python의 자료형 중 set 을 이용한 방법이다. 자료형 set은..

bluese05.tistory.com

 

728x90

'공부' 카테고리의 다른 글

[Java] Unsupported major.minor version 52.0  (0) 2020.04.26
[Git] remove cached files  (0) 2020.04.26
[Selenium] This version of ChromeDriver only supports Chrome version **  (0) 2020.04.26
[Linux] tar, gz, zip  (0) 2020.04.26
[Spring] dependency  (0) 2020.04.21
댓글