错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Python For Loops and Iterables Deep Dive

  • Coen Groot

摘要

This video aims to provide an understanding of Python’s for loop.


The video starts with the basics of a Python for-loop, including tips for programmers coming from other languages. It also discuss advanced for-loops, including how to change the flow of a loop using break (break out of a loop when done), continue (skip an item), and else statements (take an action when a loop was run through to completion). The next part  provides insight into the machinery behind for-loops, including the distinction between an iterable and an iterator, and how Python knows when there are no more items to use in a for-loop. Additionally, the video will cover creating classes that can be used in a for-loop. The video will also discuss generator functions that provide a simpler way to create an iterable. Furthermore, the video will cover generator expressions, and compare them with list comprehensions.


By the end of the video, viewers will have an understanding of for-loops in Python, including both the basics and advanced techniques, along with an understanding of the underlying mechanics. The video will also provide viewers with a good foundation for writing iterable classes and creating generator functions and expressions.


What you will learn:
  • What are Simple for-loops the Pythonic way
  • How to write a class which can be used in a for-loop
  • What are  Iterable classes
  • What are general functions and general expressions
Who this video is for:
This course is for new Python developers, or experienced developers coming from another 
language, who want to use the optimal Python syntax. And for experienced Python developers 
who want to take their use and understanding of iteration in Python to the next level.