map3 filter(), map() filter() filter(function, list)는 시퀀스의 항목들 중 함수조건이 참(True)인 항목만 추출해 구선된 시퀀스를 반환한다 >>> def f(x): return x%2 != 0 and x%3 != 0 >>> f(33) False >>> f(17) True >>> list(filter(f, range(2, 25))) [5, 7, 11, 13, 17, 19, 23] # 상동. list(), filter() 대신 사용 >>> r = [f(x) for x in range(2, 25)] [5, 7, 11, 13, 17, 19, 23] map() map(function, list)는 시퀀스의 모든 항목에 함수를 적용한 결과리스트를 반환한다 >>> def cube(x): return x*x*x .. 2020. 10. 5. 블로그에 구글맵 삽입하기/Google Map browser 2012. 2. 9. web trend map http://boowoon.egloos.com/2282937 2011. 6. 23. 이전 1 다음