Python Development: Leveraging Functions with Lambdas Generators Closures & Decorators
Lambdas are great for on-off use and once stored in a variable behave exactly like other function objects in Python. In this course youll learn how to create anonymous functions in Python using lambdas. Youll start by creating generator functions in Python to generate infinite sequences using the yield keyword. Youll then illustrate how these generator functions can be resumed from just after the previous yielded value. Moving along youll demonstrate how closures in Python are nested functions that keep track of local variables in the outer function. Youll also illustrate how decorators – bits of code allowing you to modify other pre-existing code in your program – can be implemented using closures. When youre finished with this course youll have a good grip of functions in Python which allow you to perform some incredibly complex and powerful operations.