PLEASE SUBSCRIBE!!!
In the previous lesson ( • Python Programming: Lesson 30 - Decor... ), we studied recursion, which is a cool new way to repeat multiple lines of code without needing a while loop or for loop. In this lesson, we take a look at the itertools module, providing us methods for dealing with iterables like lists and generators. See the timestamps below for a mini summary.
0:33 Review of Recursion
4:03 NEW: Intro to Itertools
7:54 NEW: count(x) Generator yields x, x+1, x+2, ...
9:41 NEW: cycle(x) Generator cycles through the elements in x over and over again
11:33 NEW: repeat(x) Generator yields x over and over again
12:39 NEW: takewhile(x,y) accepts a predicate x and yields the elements in y while x is true
14:00 NEW: chain(x, y, ...) iterates through the elements in x, then in y, etc.
15:15 NEW: accumulate(x) yields a running total of the values in x
16:33 NEW: product(x,y) yields all possible tuples (a,b) where a is in x and b is in y
18:32 NEW: permutations(x) yields all orderings of the elements in x
Ready to start object oriented programming? Check out the next lesson here: • Python Programming: Lesson 33 - Intro...
Thanks for watching, and PLEASE SUBSCRIBE!!!
Watch video Python Programming: Lesson 32 - Itertools online, duration hours minute second in high quality that is uploaded to the channel youmils03 22 August 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 62 times and liked it 1 visitors.