2
    >>> a
    [1, 2, 3]
    >>> it = iter(a)
    >>> it.next()
    1
    >>> a.remove(1)
    >>> a
    [2, 3]
    >>> it.next()
    3
    >>>

in the above codes, why the second it.next() returns 3 but not 2?

note: this question is totally different from this question, which involves the StopIteration while the problem here is in the middle.

Community
  • 1
  • 1
lily
  • 308
  • 3
  • 10

0 Answers0