What are Python Iterators and Iterables | How to create a custom Iterator |Python Interview Question

Опубликовано: 04 Октябрь 2024
на канале: Coding With Roy
1,137
32

What are Iterators in Python? What do you mean by Iterables?
Can you create a custom Iterator class?
How do Iterators work actually?

These questions have been asked in all the Python Interviews that I have attended till now. So, in this tutorial
we will be discussing about Python Iterators in depth. Hope it will help you guys in your own Python developer journey.

Topics covered in this tutorial:
What are Iterables in Python
What is Unpacking, Enumerating in brief
What are Iterators
Iterator code examples
Creating a custom iterator
How for loops work for Iterables
Advantages of using iterators

The Notebook for this tutorial:
https://bit.ly/3F4F0AB

Python Interview question series:
   • Python Interview Questions Series - B...  

Connect with me on LinkedIn:
  / sukanta-roy-448a5856  

Timestamps:
0:00 - Introduction
1:22 - Topics covered
2:05 - What are Iterables in Python?
4:10 - Unpacking Iterables code example
5:37 - Enumerating Iterables code example
7:02 - What is an Iterator?
8:38 - Iterator Code example
11:44 - Some important points about Iterators
13:51 - Creating a custom Iterator
20:00 - How for loops work
22:32 - Advantage of using Iterators

Please like the video and subscribe if you found this useful.