Introduction
Setup
Operators
variable
String
Number
Dtype & Comment
Lists
Tuples
Sets
Dictionaries
if else statement
For Loop
While Loop
iterator & iterable
Pre-Built functions
Function
Decorators
generators
Types of errors
Exceptions Handling
OOP
Regular expression
Create module
OS module
Date module
Random module
Math
Statistics module
Exercise 1
Exercise 2
Exercise 3
Learn Data Structure & Algorithm
Learn Numpy
Learn Pandas
Learn Matplotlib
Learn Seaborn
Learn Statistics
Learn Math
Learn MATLAB
Learn Machine learning
Learn Github
Learn OpenCV
Learn Deep Learning
Learn MySQL
Learn MongoDB
Learn Web scraping
Learn Excel
Learn Power BI
Learn Tableau
Learn Docker
Learn Hadoop
Set is used to store multiple collections of value in one variable. We can store too many values in a set and
perform a lot of work on it.
The set is both unordered and unindexed and does not allow duplicate values. Set items can appear in a
different order every time we use them, and cannot be referred by index number. We can store string, number
or
both at the same time in a set. we can use a capital letter and a small letter in a set.
We write sets inside the second bracket{}. The string must be written inside a single or double quotation ('', "") and numbers don't need any single or double quotes. Give a comma between two values.
Example:To check whether the value is in the set or not, "in" is used.
Example:To remove any value from the set, remove() function is used.
Example:To add value to the set add() function is used.
Example:This function is used to add one set element to another set.
Example:To remove a value from the end of a set, the pop() function is used. If we use the pop function one time, then it will remove one value from the end. Every time we do that, the value of the total will decrease from the end.
Example:To remove all the elements of a set at a time, the clear() function is used.
Example:Union function returns a new set of all items from both sets.
Example:intersection_update() function keeps all the common items present in both sets. This function will not create a new set. It will just update the set.
Example:intersection() function keeps all the common items present in both sets. This function will create a new set.
Example:symmetric_difference_update() function keeps all the items that are not present in both sets. This function will not create a new set. It will just update the set.
Example:symmetric_difference function keeps all the items that are not present in both sets. This function will create a new set.
Example:difference() function shows the difference between multiple sets. This function returns those values which only contain the first set.
Example: