← Courses

Python for AI — Beginner Foundations

Data Science

Data Structures · Lesson 38 of 76

Sets

A set holds only unique values — duplicates are dropped automatically. It's perfect for "how many different things are here?"

Python

Sets also compare groups quickly:

Python

Your turn: make a set from [1, 2, 2, 3, 3, 3] and print how many unique numbers it has.

You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →