Udemy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Development
Web Development Data Science Mobile Development Programming Languages Game Development Database Design & Development Software Testing Software Engineering Software Development Tools No-Code Development
Business
Entrepreneurship Communication Management Sales Business Strategy Operations Project Management Business Law Business Analytics & Intelligence Human Resources Industry E-Commerce Media Real Estate Other Business
Finance & Accounting
Accounting & Bookkeeping Compliance Cryptocurrency & Blockchain Economics Finance Finance Cert & Exam Prep Financial Modeling & Analysis Investing & Trading Money Management Tools Taxes Other Finance & Accounting
IT & Software
IT Certifications Network & Security Hardware Operating Systems & Servers Other IT & Software
Office Productivity
Microsoft Apple Google SAP Oracle Other Office Productivity
Personal Development
Personal Transformation Personal Productivity Leadership Career Development Parenting & Relationships Happiness Esoteric Practices Religion & Spirituality Personal Brand Building Creativity Influence Self Esteem & Confidence Stress Management Memory & Study Skills Motivation Other Personal Development
Design
Web Design Graphic Design & Illustration Design Tools User Experience Design Game Design 3D & Animation Fashion Design Architectural Design Interior Design Other Design
Marketing
Digital Marketing Search Engine Optimization Social Media Marketing Branding Marketing Fundamentals Marketing Analytics & Automation Public Relations Paid Advertising Video & Mobile Marketing Content Marketing Growth Hacking Affiliate Marketing Product Marketing Other Marketing
Lifestyle
Arts & Crafts Beauty & Makeup Esoteric Practices Food & Beverage Gaming Home Improvement & Gardening Pet Care & Training Travel Other Lifestyle
Photography & Video
Digital Photography Photography Portrait Photography Photography Tools Commercial Photography Video Design Other Photography & Video
Health & Fitness
Fitness General Health Sports Nutrition & Diet Yoga Mental Health Martial Arts & Self Defense Safety & First Aid Dance Meditation Other Health & Fitness
Music
Instruments Music Production Music Fundamentals Vocal Music Techniques Music Software Other Music
Teaching & Academics
Engineering Humanities Math Science Online Education Social Science Language Learning Teacher Training Test Prep Other Teaching & Academics
Web Development JavaScript React CSS Angular Node.Js PHP HTML5 Typescript
AWS Certification Microsoft Certification AWS Certified Solutions Architect - Associate AWS Certified Cloud Practitioner CompTIA A+ Amazon AWS Cisco CCNA CompTIA Security+ Microsoft AZ-900
Microsoft Power BI SQL Tableau Data Modeling Business Analysis Business Intelligence MySQL Qlik Sense Data Analysis
Unity Unreal Engine Game Development Fundamentals C# 3D Game Development C++ Unreal Engine Blueprints 2D Game Development Mobile Game Development
Google Flutter iOS Development Android Development Swift React Native Dart (programming language) Kotlin Mobile App Development SwiftUI
Graphic Design Photoshop Adobe Illustrator Drawing Digital Painting Canva InDesign Character Design Procreate Digital Illustration App
Life Coach Training Personal Development Neuro-Linguistic Programming Personal Transformation Life Purpose Mindfulness Sound Therapy Coaching CBT Cognitive Behavioral Therapy
Business Fundamentals Entrepreneurship Fundamentals Freelancing Business Strategy Startup Business Plan Online Business Blogging Leadership
Digital Marketing Social Media Marketing Marketing Strategy Google Analytics Internet Marketing Copywriting Email Marketing Startup YouTube Marketing

DevelopmentProgramming LanguagesPython

Python 3: Deep Dive (Part 2 - Iteration, Generators)

Sequences, Iterables, Iterators, Generators, Context Managers and Generator-based Coroutines
Rating: 4.9 out of 54.9 (1,810 ratings)
24,473 students
Created by Fred Baptiste
Last updated 4/2022
English

What you'll learn

  • You'll be able to leverage the concepts in this course to take your Python programming skills to the next level.
  • Sequence Types and the sequence protocol
  • Iterables and the iterable protocol
  • Iterators and the iterator protocol
  • List comprehensions and their relation to closures
  • Generator functions
  • Generator expressions
  • Context managers
  • Creating context managers using generator functions
  • Using Generators as Coroutines

Requirements

  • This is a relatively advanced course, so you should already be familiar with basic Python concepts, as well as some in-depth knowledge as described in the prerequisites in the course description. Please be sure you check those and make sure!
  • You will need Python 3.6 or above, and a development environment of your choice (command line, PyCharm, Jupyter, etc.)

Description

Part 2 of this Python 3: Deep Dive series is an in-depth look at:

  • sequences

  • iterables

  • iterators

  • generators

  • comprehensions

  • context managers

  • generator based coroutines

I will show you exactly how iteration works in Python - from the sequence protocol, to the iterable and iterator protocols, and how we can write our own sequence and iterable data types.

We'll go into some detail to explain sequence slicing and how slicing relates to ranges.

We look at comprehensions in detail as well and I will show you how list comprehensions are actually closures and have their own scope, and the reason why subtle bugs sometimes creep in to list comprehensions that we might not expect.

We'll take a deep dive into the itertools module and look at all the functions available there and how useful (but overlooked!) they can be.

We also look at generator functions, their relation to iterators, and their comprehension counterparts (generator expressions).

Context managers, an often overlooked construct in Python, is covered in detail too. There we will learn how to create and leverage our own context managers and understand the relationship between context managers and generator functions.

Finally, we'll look at how we can use generators to create coroutines.

Each section is followed by a project designed to put into practice what you learn throughout the course.

This course series is focused on the Python language and the standard library. There is an enormous amount of functionality and things to understand in just the standard CPython distribution, so I do not cover 3rd party libraries - this is a Python deep dive, not an exploration of the many highly useful 3rd party libraries that have grown around Python - those are often sufficiently large to warrant an entire course unto themselves! Indeed, many of them already do!


***** Prerequisites *****

Please note that this is a relatively advanced Python course, and a strong knowledge of some topics in Python is required. 

In particular you should already have an in-depth understanding of the following topics:

  • functions and function arguments

  • packing and unpacking iterables and how that is used with function arguments (i.e. using *)

  • closures

  • decorators

  • Boolean truth values and how any object has an associated truth value

  • named tuples

  • the zip, map, filter, sorted, reduce functions

  • lambdas

  • importing modules and packages


You should also have a basic knowledge of the following topics:

  • various data types (numeric, string, lists, tuples, dictionaries, sets, etc)

  • for loops, while loops, break, continue, the else clause

  • if statements

  • try...except...else...finally...

  • basic knowledge of how to create and use classes (methods, properties) - no need for advanced topics such as inheritance or meta classes

  • understand how certain special methods are used in classes (such as __init__, __eq__, __lt__, etc)


Who this course is for:

  • Python developers who want a deeper understanding of sequences, iterables, iterators, generators and context managers.

Featured review

Malvina Pushkova
Malvina P.
141 courses
12 reviews
Rating: 5.0 out of 52 years ago
This is a continuation of part 1. Though the content became even more complicated. If you are not a professional programmer than it can be a good idea to take the first 4 sections of the course and skip the last 2 sections until you gain sufficient experience.

Instructor

Fred Baptiste
Professional Developer and Mathematician
Fred Baptiste
  • 4.8 Instructor Rating
  • 12,797 Reviews
  • 45,229 Students
  • 4 Courses

Hi,

My name is Fred Baptiste.

I started my career with a PhD in mathematics and have been programming professionally for over 25 years in a variety of technologies and languages, including Python, .Net (C# and VB), Java, C++, and JavaScript to name a few, and databases including relational SQL databases such as MS SQL Server and Postgres as well as No-SQL databases such as MongoDB, Couchbase and Neo4j.

Since 2011 I have been focused on Python almost exclusively, mainly in REST API development and data management and analysis.

I have spent a lot of time and effort learning and gaining an in-depth understanding of Python and writing idiomatic Python, and I'd like to share that with you.

I'm definitely a Python enthusiast for many reasons, and I'd like to share that passion with you too!

Top companies choose Udemy Business to build in-demand career skills.
NasdaqVolkswagenBoxNetAppEventbrite
  • Udemy Business
  • Teach on Udemy
  • Get the app
  • About us
  • Contact us
  • Careers
  • Blog
  • Help and Support
  • Affiliate
  • Investors
  • Impressum Kontakt
  • Terms
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Accessibility statement
Udemy
© 2022 Udemy, Inc.