Advanced Python Series - Iterators Vs Generators

  Рет қаралды 55,803

Krish Naik

Krish Naik

Күн бұрын

Пікірлер: 52
@thalanayarswaminathansaipr7703
@thalanayarswaminathansaipr7703 3 жыл бұрын
Excellent! One additional point a function can have many yield statements however, we can have only one return statement.
@lepidoptera9337
@lepidoptera9337 2 жыл бұрын
Huh???? Where did you get this nonsense from? A function can have an arbitrary number of return statements. Multiple returns are functionally completely equivalent to a case statement or a series of if-then-else statements. A function can even have zero return statements. A function doesn't have to return a value. A function doesn't even have to finish. That's quite useful in multitasking systems that have to repeat the same functionality over and over again in the background.
@sarikavaidya6681
@sarikavaidya6681 2 жыл бұрын
You explained in very very simple and understanding manner ... thanks for making it
@tirthasg
@tirthasg Жыл бұрын
Really? I found it to be quite confusing!
@saurishreddy7023
@saurishreddy7023 2 жыл бұрын
nums = [i*i for i in [1,2,3,4,5]] for i in nums: print (i)
@PratikDalvi-mg8qx
@PratikDalvi-mg8qx Ай бұрын
Yes..! I got the real Krish who helps the needy Students .❤☺
@shailajadavangave45
@shailajadavangave45 2 жыл бұрын
Hi Krishna , before gng for interview i hv gone through ur iterator vidoe and same concept asked in interview as i hv gone through ur iterator video i was able to explain well with an example of iterator.iterviewr was very much convenienced with the example and answer .Thanks for the amazing video very well explained. I am grateful to you for these videos and easy explanation
@lepidoptera9337
@lepidoptera9337 2 жыл бұрын
As an interviewer I would have rejected you on your lack of communication skills alone. Life is not a series of smartphone texts. :-)
@pokejishnu
@pokejishnu 4 жыл бұрын
Wow this was much needed Krish sir. Thanks a lot
@ramarao_amara
@ramarao_amara 3 жыл бұрын
other than generator function , we can use generator comprehension also used for creating generators.
@AshisRaj
@AshisRaj Жыл бұрын
10:33 crux is here
@abhi9029
@abhi9029 Жыл бұрын
superb lecture Krish.
@narangfamily7668
@narangfamily7668 Жыл бұрын
Wonderful! Thank you so much.
@scortexfire
@scortexfire 2 жыл бұрын
8:40 def square(n): for i in range(n): return n**2 square(3) >>> 9 I'm getting 9 instead of 0. Why so?
@shaiksalman9010
@shaiksalman9010 2 жыл бұрын
in return put return i**2
@abhi739
@abhi739 3 жыл бұрын
Thanks Krish, very good explanation
@bongmou2845
@bongmou2845 4 жыл бұрын
Thank you for the clarification , well explained .
@animeshmishra4282
@animeshmishra4282 4 жыл бұрын
Best video needed it so much. Thankyou sir.🌟
@ranjit9427
@ranjit9427 4 жыл бұрын
Why is Iterator more memory efficient compared to the Generator??
@prannoyroy5312
@prannoyroy5312 3 жыл бұрын
It is the other way round. Generators are memory-efficient ways of processing huge datasets. They process the data incrementally and do not allocate memory to all the results at the same time.
@shahnawazkhan1636
@shahnawazkhan1636 4 жыл бұрын
Amazing krish
@pratyushbehere3580
@pratyushbehere3580 4 жыл бұрын
Still don't understand where this will be used
@swadhikarc7858
@swadhikarc7858 4 ай бұрын
Nice video krish. I can see the effort behind making people to understand 🫡
@abhishekjain7645
@abhishekjain7645 4 жыл бұрын
I bought the membership but I didn't received the study material
@krishnaik06
@krishnaik06 4 жыл бұрын
Check the community post
@donfeto7636
@donfeto7636 3 жыл бұрын
Think about it generator is like yield return in c# which just return a list which you can iterate over it , multiple return rather than 1 return value
@iftibuni
@iftibuni 25 күн бұрын
i think generators are more memmory efficent as they produce values on demand
@masterhipster8358
@masterhipster8358 2 жыл бұрын
Plz tell if im wrong sir, In your 2 point yield save the local variable value. I think Yield hold the state of local variable.
@saleemmohammad8986
@saleemmohammad8986 2 жыл бұрын
Well explained Thanks
@SigmaSid98
@SigmaSid98 10 ай бұрын
One small correction: Generators are more memory efficient than iterators in python.
@nashrahrahman3547
@nashrahrahman3547 4 жыл бұрын
Sir, can you please make a video on decorators as well ??
@kartiksharma-yw7qf
@kartiksharma-yw7qf 4 жыл бұрын
Sir any update about data science 15 month course by ineuron?
@shrinivas1086
@shrinivas1086 2 жыл бұрын
for i in range(3): here "i" which will iterate through the range values. can we call that "i" as "iterator"? if not why?
@helovesdata8483
@helovesdata8483 Жыл бұрын
No because I doesn't iterate through the range of values. i represents each individual value in the range from 0 to 2.
@vikinist
@vikinist 3 жыл бұрын
Why not we do the same task with functions
@hassanhijazi4757
@hassanhijazi4757 Жыл бұрын
As the 4th point, I think you mean the opposite, right?
@abhinavlakhani5637
@abhinavlakhani5637 4 жыл бұрын
It looks like Iterators are using "linked lists" under the hood.🤔
@melodyofsoul4933
@melodyofsoul4933 Жыл бұрын
I'm getting this error AttributeError: module 'collections' has no attribute 'Iterator' while calling this function issubclass(types.GeneratorType,collections.Iterator).
@sgn1989
@sgn1989 Жыл бұрын
issubclass(types.GeneratorType, collections.abc.Iterator) should work
@rajinigd
@rajinigd 2 жыл бұрын
sir i have a query can you please share how to use the log values for a set of values in column
@AnilKumar-do6nj
@AnilKumar-do6nj 4 жыл бұрын
Hi this is anil how to read directly excel sheet wise data without download excel file s3 bucket using python please explan
@AnilKumar-do6nj
@AnilKumar-do6nj 4 жыл бұрын
Thanks
@KairanaExpressIn
@KairanaExpressIn 4 жыл бұрын
I want to learn python in hy head, first learn html first or c language Please Reply
@amitsingh-ox4uo
@amitsingh-ox4uo 2 жыл бұрын
Didn't make any sense.Where is it used?
@mdmamun-vp9xj
@mdmamun-vp9xj 4 жыл бұрын
First viewer😘😍😍
@chinujaglan5782
@chinujaglan5782 4 жыл бұрын
ohhh
@chinujaglan5782
@chinujaglan5782 4 жыл бұрын
i was thinking i would be 1 st comment 1 like 1 view but in 18 second 18 view and 7 likes
@MuhammadShahzad-dx5je
@MuhammadShahzad-dx5je 3 жыл бұрын
#awesome
@navneetshrvstv507
@navneetshrvstv507 3 жыл бұрын
Generator is memory efficient not iterator
@sampleraja8026
@sampleraja8026 2 жыл бұрын
He has to know the difference and it's application. Video is not worth.
@gouravnandy5401
@gouravnandy5401 2 жыл бұрын
Not a good way of teaching. Doesn't make any sense
@abhidawkhar5105
@abhidawkhar5105 Жыл бұрын
Too many adds
Advance Python-Decorators Indepth Implementation
17:02
Krish Naik
Рет қаралды 39 М.
Shallow Copy Vs Deep Copy in Python
12:49
Krish Naik
Рет қаралды 82 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
What is Agentic AI? Important For GEN AI In 2025
22:36
Krish Naik
Рет қаралды 97 М.
How To Speed Up Pandas By 4X Times- Modin Pandas Library
12:08
Krish Naik
Рет қаралды 25 М.
#61 Python Tutorial for Beginners | Iterator
10:48
Telusko
Рет қаралды 358 М.
Netflix Removed React?
20:36
Theo - t3․gg
Рет қаралды 38 М.
Python Eval Function- Evaluating Python Expressions Dynamically
18:30
Decorators in Python | Python Tutorial - Day #59
13:05
CodeWithHarry
Рет қаралды 282 М.