Skip to Content
Introducing Python, 3rd Edition
book

Introducing Python, 3rd Edition

by Bill Lubanovic
September 2025
Beginner to intermediate
660 pages
12h 48m
English
O'Reilly Media, Inc.
Content preview from Introducing Python, 3rd Edition

Chapter 26. AI

Even a cat has things it can do that AI cannot.

Fei-Fei Li

Python gained much of its recent prominence from its rich set of AI tools. In this chapter, I’ll include some AI history, as well as some recent developments. Given the insane speed of current AI development, some references will inevitably be eclipsed by brighter, shinier objects.

Traditional math lets you fit the best line or curve to a group of points by minimizing errors. But with AI problems, we’re looking for patterns that might have a complex multidimensional shape, with many local minima for errors. This is pattern recognition, and we really don’t understand how the model does it. Actually, we don’t understand how we do it either.

In this chapter, we’ll cover the following:

  • The recent history of AI, including insights that led to breakthroughs

  • Python’s role in AI development, from frameworks to full models

  • An overview of the most prominent current AI models

  • Some AI exercises using a real Python-based framework

First, let’s look at some definitions of terms that are often mushed together:

Artificial intelligence (AI)

An old, ever-broadening term for machines mimicking human abilities

Machine learning (ML)

A subset of AI, in which computers learn patterns from data without explicit human direction

Deep learning (DL)

A subset of ML that uses multiple-layered neural networks

It Turns Out…​

I’ve always liked the phrase “it turns out,” when a puzzling problem is followed by the solution. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Introducing Python, 2nd Edition

Introducing Python, 2nd Edition

Bill Lubanovic

Publisher Resources

ISBN: 9781098174392Errata Page