SET : Union Method With Example

SET : Union Method With Example

Working: Union method will exclude all the duplicate elements / items in a sets

It combine all the items of two or many set in one.

Syntax:

set1.union(set2, set3,….)

Example:

a = {3,5,6}

b = {5,2,7}

c = a.union(b)

Result:

{2,5,6,2,7}

SET : Union Real world example

Collecting All The Different / same Items From Two Bags In One Bag.


SET : Intersection method with example

Working: It will take one time item / element from duplicate items / elements from two or many sets.

Syntax:

set1.intersection(set2, set3,….)

Example:

a = {3,5,6}

b = {5,2,7}

c = a.intersection(b)

Result:

{5}

SET? :Intersection Real world example

From two books, collecting those pages that are duplicated pages. And taking one page from duplicated pages.



Nilesh Ugile

Data Engineer | python | aws | spark | airflow | sql | databricks | etl/elt | snowflake |

8 个月

Thanks for sharing

要查看或添加评论,请登录

Rushikesh J.的更多文章

  • Linux Operating System

    Linux Operating System

    Linux Operating System ======================= => Linux is a community based OS => Linux is free & Open Source => Linux…

  • Infrastructure

    Infrastructure

    ================= Infrastructure ================= Servers (Machines) Databases Storage Network Security Backup =>…

  • Application Architectural Patterns

    Application Architectural Patterns

    =================================== 1) Monolithic Architecture (Outdated) 2) Microservices Architecture (Trending)…

  • DevOps Introduction

    DevOps Introduction

    =============== What is DevOps =============== DevOps = Development + Operations => DevOps is a culture/process in IT…

    2 条评论
  • Try and Exception in Python

    Try and Exception in Python

    Exception is the error and is an event, which occur when program statements are executing. It disrupts the flow of…

  • Python Array With Examples

    Python Array With Examples

    Array in Python Array in Python Array is the collection of items having same data type with contiguous memory location.…

  • Python Date Object

    Python Date Object

    We can work with time and date with Python. There are two module in Python time and datetime that used to work with…

  • String Formatting WITH Problems and Solution

    String Formatting WITH Problems and Solution

    What is String Formatting? It is the way to insert custom string or variable in a text (string). Using string…

  • SET Different Methods With Examples

    SET Different Methods With Examples

    SET Method : add() Working: This method is used to add element to set. Syntax: set.

  • Python SET Comprehension With Examples

    Python SET Comprehension With Examples

    What is Comprehension? ?We create a sequence from a given sequence is called comprehension. ?Sequence means list…