Incognition logo
Home
Learn
Practice
Leaderboard
0
All Courses
Python for AI

Python for AI

Take the Python you already know and turn it into the toolkit real AI work runs on — collections, files, text, and objects.

0% completed
0 done110 lessons
1
Grouping Values That Belong Together
2
Tuples Can't Change
3
Unpacking a Tuple
4
Collections Without Duplicates
5
Sets Have No Order
6
Checking If Something Is There
7
Tuples and Sets, Side by Side
1
Everything From Either Set
2
Only What They Share
3
What One Has and the Other Doesn't
4
Which Comparison Do You Need?
1
Labels Instead of Positions
2
Changing a Dictionary
3
When a Key Doesn't Exist
4
Looping Through a Dictionary
5
Looping Through Pairs
1
Lists Inside Lists
2
Looping Through a List of Lists
3
Lists of Dictionaries
4
Choosing the Right Collection
1
Why Programs Need Files
2
Writing Your First File
3
Reading It Back
4
Closing Files Automatically
5
Starting a New Line
6
Reading Line by Line
7
Getting Rid of the Line Break
8
Naming and Finding Files
9
Writing Erases What Was There
10
Adding Instead
1
A Spreadsheet Is Just Text
2
Splitting a Line Yourself
3
Turning Rows Into Lists
4
When Splitting Goes Wrong
5
Letting Python Do It
6
The Header Row
7
Rows as Dictionaries
8
Writing a CSV
1
Text Has Positions Too
2
Slicing Text
3
Text Never Changes
4
Changing Case
5
Trimming Whitespace
6
Searching Inside Text
7
Replacing Text
8
Splitting Text Into Pieces
9
Joining Pieces Back Together
10
Formatting Numbers
11
Cleaning Messy Text
1
Why Split Code Into Files
2
What a Module Is
3
Importing a Module
4
Importing Just What You Need
5
Renaming an Import
6
Creating Your Own Module
7
Code That Only Runs When You Run the File
8
The Standard Library
9
Saving Data as JSON
10
Putting the Pieces Together
1
Errors Are Normal
2
Knowing the Common Errors by Name
3
Catching an Error
4
Catching One Specific Error
5
Handling Different Errors Differently
6
Always Running Cleanup Code
7
Raising Your Own Errors
8
Asking Until You Get Valid Input
1
You've Been Using Objects All Along
2
Why Objects Exist
3
Creating a Class
4
Attributes
5
Setting Up an Object
6
What self Actually Is
7
Methods
8
Methods That Change the Object
9
Printing an Object Nicely
10
Building a Simple Class
1
Why Rewrite What You Already Have
2
Parent and Child Classes
3
What a Child Inherits
4
Overriding a Method
5
Calling the Parent's Version — super()
6
Extending the Constructor — super().__init__()
7
One Name, Many Behaviours
8
Duck Typing
9
Designing a Family
1
A Shorter Way to Build a List
2
Filtering Inside a Comprehension
3
Dictionary Comprehensions
4
Counting While Looping — enumerate
5
Looping Through Two Lists Together — zip
6
Building a Dictionary from Two Lists — dict(zip(...))
7
Sorting by Your Own Rule — sorted(key=…)
8
Small Nameless Functions — lambda
9
Two You'll Read More Than Write — map and filter
10
Writing Readable Code
1
Counting Things
2
A Dictionary With a Default
3
Is Any True? Are All True?
4
Numbers That Aren't Quite Exact
5
Dates and Times
6
Any Number of Arguments
7
Unpacking Into a Call
8
Reading Type Hints
9
Making Your Object Act Like a List
10
Producing Values One at a Time
11
Randomness You Can Repeat
12
Packages, pip and Virtual Environments
13
Finding Your Way Around a Library
14
Mini Dataset Project