## Introduction

Sets are an essential data structure in Python used for storing unique elements. Python provides a variety of built-in set methods to manipulate sets efficiently. In this guide, we'll explore common set methods, what they are, and how to use them effectively, along with sample code to illustrate their functionality.

## What Are Set Methods?

Set methods are built-in functions that can be applied to sets to perform various operations. These methods can be used for tasks such as adding elements, removing elements, performing set operations (union, intersection, difference), and checking for membership. Understanding these methods is crucial for working with sets in Python.

## Common Set Methods

Let's explore some of the most common set methods in Python with sample code:

### 1. `add()` - Adding Elements

``# Adding an element to a setmy_set = {1, 2, 3}my_set.add(4)`        `

### 2. `remove()` - Removing Elements

``# Removing an element from a setmy_set = {1, 2, 3}my_set.remove(2)`        `

### 3. `union()` - Set Union

``# Performing the union of two setsset1 = {1, 2, 3}set2 = {3, 4, 5}union_set = set1.union(set2)`        `

### 4. `intersection()` - Set Intersection

``# Performing the intersection of two setsset1 = {1, 2, 3}set2 = {3, 4, 5}intersection_set = set1.intersection(set2)`        `

### 5. `difference()` - Set Difference

``# Finding the difference between two setsset1 = {1, 2, 3}set2 = {3, 4, 5}difference_set = set1.difference(set2)`        `