[python] collections 모듈 연습
1. collections 모듈 collections 모듈에선 namedtuple(), OrderedDict, Counter, defaultdict, deque 등을 제공한다. (tuple, dict에 대한 확장 데이터 구조를 제공) Counter 클래스는 파이썬의 기본 자료구조인 사전(dictionary)의 확장(자식 클래스)이다.즉, 사전에서 제공하는 API를 그대로 사용할 수 있다. 2. 준비 다음과 같이 임포트하여 바로 사용하면 된다. from collections import Counter 사용 할 때에는 다음과 같이 list이나 string을 Counter안에 넣고인스턴스로 만들어서 사용. text = "Hello my name is" li = [1,2,3,"d","d",1,1,2,"go"] ..