파이썬에서 "필터"객체의 길이를 찾는 방법
>>> n = [1,2,3,4] >>> filter(lambda x:x>3,n) >>> len(filter(lambda x:x>3,n)) Traceback (most recent call last): File "", line 1, in len(filter(lambda x:x>3,n)) TypeError: object of type 'filter' has no len() 내가 얻은 목록의 길이를 알 수 없습니다. 그래서 다음과 같이 변수에 저장해 보았습니다. >>> l = filter(lambda x:x>3,n) >>> len(l) Traceback (most recent call last): File "", line 1, in len(l) TypeError: object of type 'filter' h..
2021. 1. 5.