프로그래밍/Python

Python 공부 노트 3. - 데이타 모델 (List)

Terry Cho 2013. 1. 4. 01:21

- insert,append,remove를 이용하여 데이타 추가,삭제 가능

- list.sort()를 이용하여 소팅 가능.

- 이미 소팅된 리스트에 대해서 bisect.insort({list},newvalue)하면, 소팅된 형태로  insert가 됨

- list.sort(compareFunction)을 하면 custom sorting이 가능

  def compareFunction(str1,str2):

     return cmp(len(str1),len(str2))

- * 를 하면 N배로 리스트를 복사 예를 들어 [1,2] * 2 = [1,2,1,2]

- min,max 사용 가능

그리드형