+ 1
What is the use of python "iter()" and "next()" function?
3 odpowiedzi
+ 2
AMOGHA. A. K. , I suppose you just took the content of your post from geeksforgeeks. No problem with that. But it's a bit confusing to read, that iter() takes am iterable and "converts" it to an iterator.
What happens is, that iter() creates an iterator that can be used to iterate over an iterable. An iterator is basically a value suplier that yields values "one after the other" from its associated iterable object.
0
What's the difference between an iterable and an iterator?