2

I was wondering if zip() function is a generator function since it exhausts only after one print. Could anyone clarify this?

T.Mou
  • 71
  • 1
  • 5

1 Answers1

3

The zip() function is not a generator function, it just returns an iterators.

See here: The zip() function in Python 3

You can learn more about zip() here: https://docs.python.org/3.3/library/functions.html#zip

brandonwang
  • 1,603
  • 10
  • 17