Python Decorators and Generators Q & A: Day 5 Live Session Review

Generators
Generators are just like functions that give us a sequence of values one as an iterable (which can be iterated upon using loops). Generators contain yield statements just as functions contain return statements.

Generator functions return a generator object. Generator objects are used either by calling the next method on the generator object or using the generator object in a “for in” loop.

Decorators
Decorators are a very powerful and useful tool in Python since it allows programmers to modify the behavior of function or class.

Decorators allow us to wrap another function in order to extend the behavior of the wrapped function, without permanently modifying it.

To know more about these Python Generators & Decorators covered in our Day 5 session check my blog at: https://k21academy.com/pythonday5

Join our Free Class to know more about it.

Free Class Python

 

About the Author Atul Kumar

Oracle ACE, Author, Speaker and Founder of K21 Technologies & K21 Academy : Specialising in Design, Implement, and Trainings.

follow me on:
Not found