Python Programming: Lesson 32 - Itertools

Опубликовано: 22 Август 2021
на канале: youmils03
62
1

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!!!


Смотрите видео Python Programming: Lesson 32 - Itertools онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал youmils03 22 Август 2021. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 62 раз и оно понравилось 1 посетителям.