Python Zero to Heros

Online Absolute Beginner Python Tutorials 

Every Sunday 2pm (UK time/ BST)

Get this slide deck:

slides.com/cheukting_ho/python-iterators

Recap

Python objects - int, float, str, list, dict, bool

Control flows - if-else, for loop, while loop

Functions, modeuls, classes and decorators

strings operations and regex with re

pytest with fixtures and mock

property-based testing

python linters & auto-formatters

TDD

 

Any Questions?

What is Iterator?

 

  • Iterator is an object
     
  • Iterator has __next__ method
     
  • Iterator is generated when iter() is used on iterable object
     
  • Iterator is also an iterable object

Huh?

Iterables????

 

  • Iterable is an object
     
  • Iterable can generate an iterator
     
  • Iterable has the __iter__ and sometimes __getitem__ methods
     
  • Let's check some of the objects that we know

 

Next week:
Generators

Sunday 2pm (UK time/ BST)

There are also Mid Meet Py every Wednesday 1pm

Testing month in June

Python Iterators

By Cheuk Ting Ho

Python Iterators

  • 1,016