Python: Iteration and Exceptions
Interactive

Python: Iteration and Exceptions

Skillsoft
Updated Oct 17, 2019

Course Overview

Iterations and exceptions are nuanced in Python, and so it is important to fully understand how they work in order to produce quality software. In this course, you will learn about comprehensions, a powerful, concise syntax for creating iterable objects. The course also covers iteration and iterables, and exception handling.


Target Audience

Beginner Python developers, and developers with experience in other languages looking to start programming in Python


Learning Objectives

  • create a list comprehension in Python
  • create a nested comprehension in Python
  • use the zip() function in a generator in Python
  • create a set comprehension in Python
  • create a dictionary comprehension in Python
  • describe the function of iter(), next() and StopIteration() in Python iteration
  • use the map() function in an iteration in Python
  • use the filter() function in an iteration in Python
  • use functools.reduce() to iterate over an iterable
  • implement a custom iterable class in Python
  • implement an iterable using consecutive integer indexing in Python
  • implement an iterable using the extended iter() function
  • create a simple generator in Python
  • create a lazy generator in Python and understand its characteristics
  • create a recursive generator in Python
  • write a basic exception handler in Python to catch all exceptions
  • write an exception handler in Python to catch a specific error, and recognize the reason why catching all errors is bad practice
  • describe the inheritance hierarchy of exceptions in Python and how to catch multiple exception types using a base type
  • raise an exception using a payload and retrieve a payload when handling an error
  • create a custom exception class in Python
  • access and manipulate traceback objects for an exception in Python
  • use assertions in a Python program
  • use implicit and explicit chaining of exceptions in Python
  • create an iterable data type that handles exceptions in Python