L 25: SETS IN PYTHON | SET OPERATIONS IN PYTHON | PYTHON COURSE FOR BEGINNERS
A set is an unordered collection of items. Every set element is unique (no duplicates) and must be immutable (cannot be changed).
However, a set itself is mutable. We can add or remove items from it.
Sets can also be used to perform mathematical set operations like union, intersection, symmetric difference, etc.
Creating Python Sets:
A set is created by placing all the items (elements) inside curly braces {}, separated by comma, or by using the built-in set() function.
It can have any number of items and they may be of different types (integer, float, tuple, string etc.). But a set cannot have mutable elements like lists, sets or dictionaries as its elements.
Creating an empty set is a bit tricky:
Empty curly braces {} will make an empty dictionary in Python. To make a set without any elements, we use the set() function without any argument.
Modifying a set in Python:
Sets are mutable. However, since they are unordered, indexing has no meaning.
We cannot access or change an element of a set using indexing or slicing. Set data type does not support it.
We can add a single element using the add() method, and multiple elements using the update() method. The update() method can take tuples, lists, strings or other sets as its argument. In all cases, duplicates are avoided.
Removing elements from a set:
A particular item can be removed from a set using the methods discard() and remove().
The only difference between the two is that the discard() function leaves a set unchanged if the element is not present in the set. On the other hand, the remove() function will raise an error in such a condition (if element is not present in the set).
#python #set #parnikatutorials
00:00 - Introduction
00:24 What is a set
01:53 Creation of set
03:56 Length of a set
03:50 Displaying elements in a set
05:20 Adding elements in a set
07:29 Removing elements in a set
10:44 Set operations
13:44 Implementation in Jupyter Notebook
Website: www.parnikatutorials.in
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id=109245950811428&ref=content_filter
Linkedin: https://www.linkedin.com/in/parnika-tutorials-a8a9831b2/
Pinterest: https://in.pinterest.com/parnikatutorials0892/
Instagram: https://www.instagram.com/parnikatutorials/
Playlists:
Virtual Coffee with Jagadeesh: https://youtube.com/playlist?list=PL4x0v29DZ2pArePUk30o6Twn7sqnqbYCH
Digital Logic: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pA2ZmL3dclnA-HfHkFAy0GI
Computer Organization and Architecture: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pBRd8bChJJFtTn6ClJhKzfZ
C Programming: https://www.youtube.com/watch?v=h9LtX_R-7uA&list=PL4x0v29DZ2pAIQdtRr-1zaYnqGiD_fU0M
Data Structures: https://www.youtube.com/watch?v=m51BGPXdPAQ&list=PL4x0v29DZ2pCtKml6NNoBhYK4K_QnsCA_
Theory of Computation: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pDq-5SI9KlYxPDKdYCcmgJm
Compiler Design: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pBsF-lPUHQ_8uRy-LbDSHIH
Operating Systems: https://www.youtube.com/watch?v=vCCmq8hTC8Y&list=PL4x0v29DZ2pD6MzSQMIDSawLSKUZTFfxE
Databases: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pCYEa9s3r5zWrFYIxGivlEC
Computer Networks: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pBBOq-QsHtCuA53IlRxIQNm
For GATE PYQs and much more explore: https://www.youtube.com/c/ParnikaTutorials/playlists
TAGS:
WHILE LOOP
WHILE LOOP IN PYTHON
PYTHON TUTORIALS FOR BEGINNERS
FLOWCHART OF WHILE LOOP
WHAT IS A FLOWCHART
ITERATIVE STATEMENTS IN PYTHON
FREE LECTURES OF PYTHON
PYTHON COURSE FOR BEGINNERS
ITERATIVE STATEMENTS IN PYTHON
BEST PYTHON COURSE
BEST PYTHON COURSE FOR FREE
PARNIKA TUTORIALS
PYTHON PROGRAM TO COMPUTE SUM OF N NATURAL NUMBERS
HOW TO WRITE PYTHON PROGRAM TO COMPUTE SUM OF FIRST N NATURAL NUMBERS
FOR ELSE IN PYTHON
FOR ELSE STATEMENT IN PYTHON
FOR ELSE WITH AN EXAMPLE IN PYTHON
Factorial program using for loop
How to write python program to find factorial of a number
what is factorial of a number
Break vs continue vs pass in python
Break statement in python
Continue statement in python
pass statement in python
Need for pass statement in python
Break, continue, & pass in python
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «L 25: SETS IN PYTHON | SET OPERATIONS IN PYTHON | PYTHON COURSE FOR BEGINNERS», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.