SET : Union Method With Example
Rushikesh J.
QA Automation Engineer @Vinz Global | Robot Framework | Manual Testing, Automation Testing | Python | Selenium | GIT | JIRA | Immediate Joiner | API Testing Using Postman | Jenkins
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.
Data Engineer | python | aws | spark | airflow | sql | databricks | etl/elt | snowflake |
8 个月Thanks for sharing