return vs yield Generator can create data instantly without creating multiple data in advance. def return_abc(): return list("ABC") def yield_abc(): yield "A" yield "B" yield "C" >>> print(return_abc()) ['A', 'B', 'C'] >>> print(yield_abc()) yield vs yield from With yield from, it transformates list immediately. def yield_abc(): for ch in ["A", "B", "C"]: yield ch def yield_abc(): yield from ["A..