generator를 간단히 설명하면, iterator를 생성해주는 function이다. ※ iterator? https://dev-jy.tistory.com/20 [Python] iterable? iterator? iterable? iterator? iterable의 의미는 요소를 하나씩 차례로 반환 가능한 object를 뜻한다. iterable의 예로는 sequence type인 list, str, tuple 등이 있고, non-sequence type인 dict나 file도 iterable 하다.. dev-jy.tistory.com 아래의 예시를 보자. def generator(n): i = 0 while i < n: yield i i += 1 얼핏 보면 일반 함수와 비슷해 보이지만, yield라는 ..