Python Program to Different Set Operations

preview_player
Показать описание
#BackCoding

defined two set variables and we have performed defferent

Python offers a datatype called set whose elements must be unique. It can be used to perform different set operations like union, intersection, difference and symmetric difference

this program, we take two different sets and perform different set operations on them. This can equivalently done by using set methods.

#python
#programming
#shorts
Рекомендации по теме
Комментарии
Автор

def deffSrtOperation(E, N):

print("Union of E and N is ", E|N)

print("Intersection of E and N is ", E & N)

print(" Defference of E and N is ", E-N)

print("Symmetric defferent of E and N is ", E^N)


E={0, 2, 4, 6, 8}
N={1, 2, 3, 4, 5}

deffSrtOperation(E, N)

BackCoding