if iter and next are predefined functions then why do we need to define them again in code
Are'nt iter and next predefined fuctions
Hi Surbhi,
Correct, iter
and next
are the predefined functions, and you can put any python iterable object in iter() function and by using the next function you get the next element.
Why Jatin bhaiya implemented them again from scratch is just to go more deep on these functions, so that students could get thorough understanding of this function works under the hood.
It’s totally find if you just use iter() predefined function.
Thanks
-
Mohit