## Sunday, October 11, 2020

Solution Exercise 202: a python program to examines whether two sets are disjoint or not #### Exercise 202

Write a program in python as a function which examines whether two sets are disjoint or not. If the two sets are disjoint, the function must return True and False if not.

#### Solution

``````def examineSet(E , F):
# using and initializing a counter
counter = 0
# we test if there is a common element of E and F and incrementing the counter
for x in E:
if x in F:
counter +=1
if counter > 0:
return True
else:
return False

# Testing algorithm
E = {"Java", "Python", "Javascript", "C ++", "C #"}
F = {"VB.ET", "Java", "Kotlin", "Python"}
print(examineSet(E , F)) # display True

G = {"Zend Framework", "Django", "Flask"}
H = {"AngularJS",  "Ionic Framework" , "ReactJS"}
print(examineSet(G , H)) # display False``````

Younes Derfoufi
my-courses.net

## Python Exercises With Solutions

1. Python Arithmetic Exercises
2. Equations & System Of Equations
3. Polynomials and Functions
4. Python Arithmetic Exercises
5. Numpy, Matplolib, Sympy , Scipy - Exercises
6. Python Arithmetic Exercises

Younes Derfoufi

## Sample Text 