-1

I'm new to python ,and just trying to figure out why two ways? any specific reason? which one is better?

I've tried searching but not able to find it.

1 Answers1

0

The simplest answer is that the justification is similar for next(x) as it is for len(x). Fredrik Lund summarises Guido's response on that topic in this article.

holdenweb
  • 33,305
  • 7
  • 57
  • 77