Python Tutorial: Iterators and Iterables - What Are They and How Do They Work?

  Рет қаралды 383,165

Corey Schafer

Corey Schafer

Күн бұрын

Пікірлер: 317
@gioxc88
@gioxc88 6 жыл бұрын
best python instructor ever
@alkhashtee
@alkhashtee 6 жыл бұрын
True
@ikhairi83
@ikhairi83 5 жыл бұрын
While True:
@waex7089
@waex7089 5 жыл бұрын
100% True
@jcinaz
@jcinaz 5 жыл бұрын
I couldn’t agree more.
@shreyashimukhopadhyay6354
@shreyashimukhopadhyay6354 5 жыл бұрын
HardCore my thoughts exactly!
@erdi749
@erdi749 3 жыл бұрын
These tutorials are epic, how can you talk 20mins without any single unnecessary word, truly amazing. Thank you so much Corey. You are my #1 Pyhton reference in my classes I teach in the collage! Keep up the great work!
@informativecontent4778
@informativecontent4778 Жыл бұрын
practice
@mahesh_kok
@mahesh_kok 6 жыл бұрын
Corey Schafer ... U are the only Foreign KZbin, Instructor of Python whom i Follow. Your Videos contains information multifolds 10 which we get from any other video.. I am Surprised how do u do this...You make Sound Python Like Childs Play ... Hats off to u ... Expecting Machine Learning from You. That could be the Internet Breaker Videos of Yours
@WaldoTheWombat
@WaldoTheWombat 2 жыл бұрын
1. In Python, an object can be called an "iterable" if it has the dunder method __iter__ which should return an iterator and an iterator is an object that has the method __next__. 2. __iter__ is a method that a python list has. 3. By performing the for loop on the list, python invokes that list's __iter__ method which returns an iterator that we can loop over. we can do next(mylist.__iter__()) which invokes the iterator's __next__ method or call or invoke it directly: mylist.__iter__().__next__() we can also do next(iter(mylist)) "Generators are iterators as well, but the duder iter and duner next methods are created automatically."
@ji-axinliu4448
@ji-axinliu4448 3 жыл бұрын
Thank you, Sir. I wake up at 4 in the morning and continue watching your lessons.
@aman0509
@aman0509 4 жыл бұрын
Closure and Decorator tutorial of yours was my first experience and I am telling you, you have explained it in such a good way that I cannot forget it ever. I am not being dramatic but your explanation method is magical. When I am learning any concept, there are things which are buried inside my mind and but it cannot get out because I feel confused and also nobody talking about the same or have that kind of explaining system as yours. It's like you are connected to my mind. So, Thank You Very Much!! God Bless You!!
@coreyms
@coreyms 4 жыл бұрын
Thanks! Glad to hear that
@halim1885
@halim1885 6 жыл бұрын
i've tried a lot of teachers in order to make progress and non of them works , you are the best sir i advise everyone want to learn python to watch your serie
@baqirhusain5652
@baqirhusain5652 4 жыл бұрын
Oh My God....I didn't know learning python can be this addictive.... Thank you sooooooooooooooo muchhhh
@shahzebafroze4093
@shahzebafroze4093 6 жыл бұрын
Thank you for making these awesome videos!! Goal after graduation: support your channel.
@Worldofdave
@Worldofdave 3 жыл бұрын
Did you by now :D
@veeplusvee
@veeplusvee 2 жыл бұрын
Corey, Simply you are the best when it comes to making someone understand the concept. Unless someone understands the concept, it is very difficult to write codes that are lot efficient and at the same time very easy to understand/read. I wish everyone who makes video on programing follows a similar template for teaching. Thanks a lot.
@judeleon8485
@judeleon8485 4 жыл бұрын
Corey, you're awesome! You always make my day. Anytime I'm in need need of a lesson on any python topic, your channel is always my first port of call, to see if you have it. You always know how to make it sink in so well. Thanks
@emmanuel5566
@emmanuel5566 4 жыл бұрын
dude.. your voice is so distinct and your explanation is crystal clear. if I can't find something on StackOverflow or if I'm learning a new concept in python, your channel is THE resource for me. Great content. Thank you for keeping it free.
@Greenbay-bn3yk
@Greenbay-bn3yk 5 ай бұрын
Old but Gold. What an excellent explanation
@IterativeTheoryRocks
@IterativeTheoryRocks 4 жыл бұрын
Excellent idea with the coding problems. You never really understand something until you have to use it!
@dev4life
@dev4life 5 жыл бұрын
Correction at 1:38 Corey said "Loops aren't the only thing that we can loop over " but he meant "Lists aren't the only thing that we can loop over "
@wasadasify
@wasadasify 5 жыл бұрын
gee thanks
@rajgiriyt8494
@rajgiriyt8494 3 жыл бұрын
explaining each and every steps. where were you before. please do not leave this way of teaching. we beginners needs you
@calebthompson1037
@calebthompson1037 2 жыл бұрын
Classes in school should be like this a hyperlink to what you dont understand included. 💯
@HareshRathod
@HareshRathod 4 жыл бұрын
OMG! Watching since last 4.5 hours, dont know when last I have wateched videos for so long. Addictive. Corey you must be a Teacher. Thanks for such nice videos
@techcode_man
@techcode_man 5 жыл бұрын
Corey, Thank you for explaining this so well and simple. I have been using both iterators and iterables for while, now it makes a lot of sense.
@RuslanSheffchenko
@RuslanSheffchenko 11 ай бұрын
thank you so much for this video. I've been queering bing chat and bard chat for a couple of hours on the iterable and iterator topics but none of them managed to explain the stuff to me in a so clear way that you did.
@feernot
@feernot 5 жыл бұрын
You seriously teach this stuff better than anyone I've found. Thank you so much!
@yaboi1525
@yaboi1525 4 жыл бұрын
You're the best instructor I ever had. Thanks for all your precious efforts it mean a lot.
@gajatanu2962
@gajatanu2962 Жыл бұрын
Even after years, This is easy to understand and relevant, Thank you very much man
@akashsrane
@akashsrane 4 жыл бұрын
Just half done with the video and just want to say WOW!!! Corey, try writing your own python book.
@TonyFlexPromo
@TonyFlexPromo 6 жыл бұрын
At first i was totally scared of iterators. Next i took a study and understood how do they work and why they are used. Next i wrote some iterators and generators on my own. Then i got a question about iterators on job interview and i was one of few people who actually answered the question (as they said later). Now i really love this feature of python and this is kinda future of it because whole async thing is based on yield thing. Thank you for videos! I continue to learn a lot from you!
@pedrocontrerasavendano8578
@pedrocontrerasavendano8578 6 жыл бұрын
Precise, coherent, well articulated and well structured; good tutorial, thanks
@zyenapz
@zyenapz 3 жыл бұрын
Thanks for the straightforward and non-verbose explanation!
@furankuraw7741
@furankuraw7741 6 жыл бұрын
Thank you so much for the consistent videos and tutorials and the help that you provide for people new to this ^^
@ErnestGWilsonII
@ErnestGWilsonII 6 жыл бұрын
Dang it, I wanted to say FIRST! :)
@beginner_bro
@beginner_bro 4 ай бұрын
This is your first video I am watching. And this single video forced me to subscribe your channel. Great job man
@chuckles8519
@chuckles8519 2 жыл бұрын
You have a very clear teaching style - a very valuable talent to have!
@albertdugba
@albertdugba 6 жыл бұрын
You're definitely the best python instructor on KZbin by far...But some of us will appreciate it you could maximise the screen size we can clearly see instead of straining our eye which is probably not the best. Thank you
@vvkkumar3691
@vvkkumar3691 5 жыл бұрын
Hi Corey, most of my doubt got clear through this channel . Thank u so much for this . I am suggesting two more topic please make a video on those. 1. Why Tuple is faster than List ? 2. Why List comprehension is faster than for loop?
@Ammothief41
@Ammothief41 5 жыл бұрын
So python lists are singly linked lists! Awesome! Thanks for this and the tutorials on generators. I purchased a python book but it never delved into the material as deeply as what I wanted. Thanks.
@thomasziereis330
@thomasziereis330 4 жыл бұрын
Python lists are not linked lists
@arjunkrishna721
@arjunkrishna721 3 жыл бұрын
you can technically get a reversed iterator, that'll look something like i_nums = reversed(nums) calling next(i_nums) will iterate through the list backwards. Much love, awesome teaching !
@pranavnyavanandi9710
@pranavnyavanandi9710 3 жыл бұрын
Hi. Do you mean reversed(i_nums)?
@venkatdevireddy650
@venkatdevireddy650 6 жыл бұрын
Ur videos are awesome Corey I have been watching all ur videos... please make an video on SYS module as well as XML parsing...I have got bunch of videos from you tube none other videos are up to the mark as u...ur explanation in any concept is at peeks no body beats u... thanks a lot
@sg8581
@sg8581 Жыл бұрын
One of the best explanations on iterators. Thanks a ton!
@sampleraja8026
@sampleraja8026 2 жыл бұрын
He can make sense to even an absolute beginner, good
@rainman13579
@rainman13579 3 жыл бұрын
Still being perfect explanation, there is still a need for preparation work to understand all the stuff Corey is explaining.
@danielkamau8436
@danielkamau8436 3 жыл бұрын
good_tutor = "Corey Schafer" while True[good_tutor]: next(good_tutor) #looping forever sir thanks for expensive, but free endless knowledge. go beyond.
@madhusudhanreddy650
@madhusudhanreddy650 5 жыл бұрын
superbly explained,has none programmer can easily understand dif btwn Iterables and iterator
@Matharendre
@Matharendre Жыл бұрын
It really sums up the concepts in a concise but precise way. Thank you a lot for this!
@AshisRaj
@AshisRaj 2 жыл бұрын
My search ends here. Excellent explanation
2 жыл бұрын
A video on unit testing iterables, generators, and, unit testing functions that consume iterable objects would be great.
@swapnilp4629
@swapnilp4629 2 жыл бұрын
looks I found this bit late since this was published but trust me Your are the Best . I have gone through so many videos but the way you explain and demonstrate is AWESOME!! Keep it up :) All the best...
@xlulu464
@xlulu464 4 жыл бұрын
finally i can try to understand why for loop is different from while loop. thanks
@xaverxassnytz2746
@xaverxassnytz2746 5 жыл бұрын
very good explanation in this and generators video (also watched your other videos) - thanks to Corey coming from old languages like Fortran, Cobol, Pascal and I just began learning python 3 months ago and this videos helped me a lot to get a basic knowledge
@DioD3
@DioD3 4 жыл бұрын
Excellent video. Thank you! You are my favorite programing(python) teacher.
@rossli8621
@rossli8621 2 жыл бұрын
This should be in my school's programming 101 course!
@hubertcombomarketing2693
@hubertcombomarketing2693 4 жыл бұрын
Great Python Iterators and Iterables Tutorial. Thank You.
@grzltn9716
@grzltn9716 6 жыл бұрын
Perfectly pitched overview. Thank you.
@bright5801
@bright5801 4 жыл бұрын
before i watch any python tutorial i check to see if Corey has done it first
@shashishekhar----
@shashishekhar---- 2 жыл бұрын
Thank you so much Corey, much appreciated how helpful this(these) videos are, just thank you 👍
@DevinderKumar
@DevinderKumar 4 жыл бұрын
Super, very useful lesson. Great stuff in a shortest possible time. Thanks a lot.
@666shadowblade666
@666shadowblade666 2 жыл бұрын
Again, exactly what I was needing to clarify. Thanks.
@Sabre00
@Sabre00 5 жыл бұрын
From the time you mentioned the never ending generator and iterators not being able to be recalled it reminded me of a database auto-increment field. Just waiting for the timeseries MatplotLib video.
@TheSumanb
@TheSumanb 3 жыл бұрын
Thanks a ton ... your way of teaching is one of the best , please keep on posting tutorials on pandas and Numpy or any advanced python topics , thanks
@panditnandlalpatherwali5979
@panditnandlalpatherwali5979 6 жыл бұрын
Corey I am big fan of you videos, kindly post the video on pytest
@yuanli5619
@yuanli5619 4 жыл бұрын
Best Python tutorial
@tijanimoncef5314
@tijanimoncef5314 3 жыл бұрын
I learn much thanks to your courses. I would just make a remarque : in class MyRange __next__ it should be (if self.value > self.end:) rather than (if self.value >= self.end:)
@adamobaid3558
@adamobaid3558 5 жыл бұрын
Thank you, you are great instructor. These videos are awesome and have helped me so much. I will make a contribution when I get hired soon!
@sparksays7247
@sparksays7247 2 жыл бұрын
The trick I used to remember the difference is in the word. Iterable=“able” to be “iterated”. Hope that helped someone 😅
@marioestrada2233
@marioestrada2233 3 жыл бұрын
Many thanks man! You are truly great at teaching! Please continue with this awesome work
@subhamthemusicalguy8851
@subhamthemusicalguy8851 4 жыл бұрын
Best video for Python.Thank you sir
@samed3554
@samed3554 2 жыл бұрын
Very plain and well explained. Thank you Corey, subbed.
@faressalehi5553
@faressalehi5553 3 жыл бұрын
لقد تعلمت منك كثيرا,,, أسأل الله أن يشرح صدرك للإسلام ويدخلك الجنة.
@bharadwajsaibandaru4323
@bharadwajsaibandaru4323 3 жыл бұрын
Hey Corey ! there you go . The best python instructor on KZbin ever . Kudos to your subject knowledge and teaching in an easy and understandable way . Expecting JavaScript tutorials from you too.
@deojeetsarkar2006
@deojeetsarkar2006 5 жыл бұрын
this guy's a genius
@peterdannemann2041
@peterdannemann2041 6 жыл бұрын
Awesome content as always. Please make a video on asynchronous python programming!
@billgarcia471
@billgarcia471 3 жыл бұрын
Thanks a lot for the video, man it's very helpful to explain some vague ideas from some modules.
@MagnusAnand
@MagnusAnand 5 жыл бұрын
This video is amazing! Your teaching skills are top
@TheGroundskeeper
@TheGroundskeeper 2 жыл бұрын
So, weird moment for me. I like to go back over the parts where my ADHD started to go crazy, and when you said "Now remember I said iterators are objects with a state that..." is when I went to back up a few minutes to get back on track. When I randomly let go, you said "iterators are objects with a state that...", so I weirded out and instantly now remember this rule. I have absorbed your power. There can only be One.
@gustavojuantorena
@gustavojuantorena 3 жыл бұрын
This video is pure gold!
@DomenicoTanzarella
@DomenicoTanzarella 4 жыл бұрын
Brilliant Corey: one of your best videos!
@parmachine470
@parmachine470 3 жыл бұрын
Here' the beef! lots of pretenders, but Corey is the real deal. Iterators, generators, closures. All from the same county.
@MehmetMustafaICER
@MehmetMustafaICER 5 жыл бұрын
Thank you for this video. It is pretty clear and to-the-point. Well done.
@swapneelsahu9440
@swapneelsahu9440 3 жыл бұрын
for anyone who doesnt understand why he keeps saying "dunder" before each method names , he means to say "DOUBLE UNDERSCORE" iter,next,etc *basically instead of saying "DOUBLE UNDERSCORE" each time, he says "dunder" , since its easier to say* *D-UNDER* ===> Double UNDERscore
@zikomo8913
@zikomo8913 4 жыл бұрын
Holy shit, even a summary at the end! Can a tutorial get any better than this?
@temilolafamakinwa1626
@temilolafamakinwa1626 Жыл бұрын
Excellent explanations are always!!
@rawlespringer3917
@rawlespringer3917 5 жыл бұрын
wow you certainly have a gift for teaching...
@Everyday-Explore
@Everyday-Explore 5 жыл бұрын
Wonderful teacher. Clear precise and best..
@jessicabrown1987
@jessicabrown1987 4 жыл бұрын
Corey you are the best.
@johnwight6041
@johnwight6041 Жыл бұрын
Wow really good explanations! This makes a lot of sense
@zhukovmisha
@zhukovmisha 5 жыл бұрын
Thank you for such a profound explanation!
@szabikrdev5066
@szabikrdev5066 2 жыл бұрын
Cheers man, this was extremely useful piece of content!
@2mitable
@2mitable 5 жыл бұрын
thank you for this amazing video i have seen lot of videos from sentdex but still sometimes i did not understand as compare to you explanation Thank you very much you are helping like us soon i l help you i m trying to freelance in python thank you :D
@DASyam-tb7qt
@DASyam-tb7qt 5 жыл бұрын
I used to listen to sentdex but after finding schafer, I found myself listening to schafer like 90% of the time. No hate to sentdex, tho. Subbed to both.
@klo1603
@klo1603 6 жыл бұрын
Had a long time issue in understanding this concept. You, Corey has always made easy to understand. Can you please make a series on selenium in python.
@wongkingshun
@wongkingshun Жыл бұрын
so what is iterator?
@kentsang9376
@kentsang9376 3 жыл бұрын
very great video, clear my concept!! Thank you!
@JuanCEOs725
@JuanCEOs725 Жыл бұрын
Simply the best!
@billykotsos4642
@billykotsos4642 4 жыл бұрын
Great Tutorial
@MauriceWilliams
@MauriceWilliams 4 жыл бұрын
Thanks Corey you delivered as usual.
@Alex-rw9yj
@Alex-rw9yj 2 жыл бұрын
Thank you, man! Very clear and concise.
@alexandredamiao1365
@alexandredamiao1365 4 жыл бұрын
Your lectures are amazing! Thank you so much for this!
@xiaoweidu4667
@xiaoweidu4667 4 жыл бұрын
fantastic teacher
@tunkyi7162
@tunkyi7162 5 жыл бұрын
you are making me clear things up. I gave a like and subscribed to your channel.
@whoami2091
@whoami2091 3 жыл бұрын
You are a king man!
@TheNormanbro
@TheNormanbro 4 жыл бұрын
Everytime when he says "dunder", i start to laugh because of "Dunder code" episode of The Office. And this is a great video. Thank you.
@medi7573
@medi7573 6 жыл бұрын
Great Tutorial.
@hirunahansaka646
@hirunahansaka646 9 ай бұрын
thank you very clear your explanation
@MikeLisanke
@MikeLisanke 5 жыл бұрын
Corey, Liked your video and thought it was instructive but you left a question on the table. You said that an iterable object can be looped over, and has a dunder __next__ method... but later showed us how to create a generator which uses a yield. You say (as do many) that they like the form of a generator object (rather than the programmer maintaining the stateful mechanism for python) BUT you didn't Say IF the generator object Was considered an iterable object... obviously you showed us looping but does it have a __next__() method? Just a piece of the pie missing which I thought would have added to the story. Thanks again, Mike
@mostafaghanem3984
@mostafaghanem3984 11 ай бұрын
Thank you , you’re the goat
Python Coding Problem: Creating Your Own Iterators
13:47
Corey Schafer
Рет қаралды 67 М.
Python Generators Explained
28:37
Tech With Tim
Рет қаралды 159 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 176 МЛН
10 Python Tips and Tricks For Writing Better Code
39:21
Corey Schafer
Рет қаралды 1,3 МЛН
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 414 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,2 МЛН
Python dataclasses will save you HOURS, also featuring attrs
8:50
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 109 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
Python Tutorial: Context Managers - Efficiently Managing Resources
20:37
Iterable VS Iterator Explained In Python
8:23
Indently
Рет қаралды 14 М.