Python: Iteration and Exceptions


Overview/Description
Target Audience
Prerequisites
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description
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

Prerequisites
None

Expected Duration (hours)
3.7

Lesson Objectives

Python: Iteration and Exceptions

  • start the course
  • 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
  • Course Number:
    pg_pyth_a03_it_enus

    Expertise Level
    Beginner