Why sets are used
๐ Scenario: Imagine you have a list of fruits you bought from the market, but some fruits are repeated. You want to find out which unique fruits you have without any duplicates.
๐ฏ Goal: Learn how to use a set in Python to find unique items from a list and understand why sets are useful.
๐ What You'll Learn
Create a list called
fruits with some repeated fruit namesCreate a set called
unique_fruits from the fruits listPrint the
unique_fruits set to see only unique fruit names๐ก Why This Matters
๐ Real World
Sets help when you want to find unique things like unique customers, unique products, or unique words in a text.
๐ผ Career
Understanding sets is important for data cleaning, removing duplicates, and improving program efficiency in many programming jobs.
Progress0 / 4 steps