Tutorialsteacher

Follow Us

Articles
  • C#
  • C# OOP
  • ASP.NET Core
  • ASP.NET MVC
  • LINQ
  • Inversion of Control (IoC)
  • Web API
  • JavaScript
  • TypeScript
  • jQuery
  • Angular 11
  • Node.js
  • D3.js
  • Sass
  • Python
  • Go lang
  • HTTPS (SSL)
  • Regex
  • SQL
  • SQL Server
  • PostgreSQL
  • MongoDB
  • Python - Get Started
  • What is Python?
  • Where to use Python?
  • Python Version History
  • Install Python
  • Python - Shell/REPL
  • Python IDLE
  • Python Editors
  • Python Syntax
  • Python Keywords
  • Python Variables
  • Python Data Types
  • Number
  • String
  • List
  • Tuple
  • Set
  • Dictionary
  • Python Operators
  • Python Conditions - if, elif
  • Python While Loop
  • Python For Loop
  • User Defined Functions
  • Lambda Functions
  • Variable Scope
  • Python Modules
  • Module Attributes
  • Python Packages
  • Python PIP
  • __main__, __name__
  • Python Built-in Modules
  • OS Module
  • Sys Module
  • Math Module
  • Statistics Module
  • Collections Module
  • Random Module
  • Python Generator Function
  • Python List Comprehension
  • Python Recursion
  • Python Built-in Error Types
  • Python Exception Handling
  • Python Assert Statement
  • Define Class in Python
  • Inheritance in Python
  • Python Access Modifiers
  • Python Decorators
  • @property Decorator
  • @classmethod Decorator
  • @staticmethod Decorator
  • Python Dunder Methods
  • CRUD Operations in Python
  • Python Read, Write Files
  • Regex in Python
  • Create GUI using Tkinter
Entity Framework Extensions - Boost EF Core 9
  Bulk Insert
  Bulk Delete
  Bulk Update
  Bulk Merge

Built-in Set Functions in Python

The following table lists all the functions that can be used with the set type in Python 3.

MethodDescription
set.add()Adds an element to the set. If an element is already exist in the set, then it does not add that element.
set.clear()Removes all the elements from the set.
set.copy()Returns a shallow copy of the set.
set.difference()Returns the new set with the unique elements that are not in the another set passed as a parameter.
set.difference_update()Updates the set on which the method is called with the elements that are common in another set passed as an argument.
set.discard()Removes a specific element from the set.
set.intersection()Returns a new set with the elements that are common in the given sets.
set.intersection_update()Updates the set on which the instersection_update() method is called, with common elements among the specified sets.
set.isdisjoint()Returns true if the given sets have no common elements. Sets are disjoint if and only if their intersection is the empty set.
set.issubset()Returns true if the set (on which the issubset() is called) contains every element of the other set passed as an argument.
set.pop()Removes and returns a random element from the set.
set.remove()Removes the specified element from the set. If the specified element not found, raise an error.
set.symmetric_difference()Returns a new set with the distinct elements found in both the sets.
set.symmetric_difference_update()Updates the set on which the instersection_update() method called, with the elements that are common among the specified sets.
set.union()Returns a new set with distinct elements from all the given sets.
set.update()Updates the set by adding distinct elements from the passed one or more iterables.
TUTORIALSTEACHER.COM

TutorialsTeacher.com is your authoritative source for comprehensive technologies tutorials, tailored to guide you through mastering various web and other technologies through a step-by-step approach.

Our content helps you to learn technologies easily and quickly for learners of all levels. By accessing this platform, you acknowledge that you have reviewed and consented to abide by our Terms of Use and Privacy Policy, designed to safeguard your experience and privacy rights.

[email protected]

ABOUT USTERMS OF USEPRIVACY POLICY
copywrite-symbol

2024 TutorialsTeacher.com. (v 1.2) All Rights Reserved.