## Thursday, November 12, 2020

Solution Exercice 88: python algorithm which determines the list of characters in s1 not in s2 #### Exercise 87

Write a Python algorithm as a function which takes as parameter a tuple of two strings (s1, s2) and which returns the list of characters in s1 and not in s2. Example: if s1 = 'Python language' and s2 = 'Java Programming', the function returns the list:
``['y', 't', 'h']``

#### Solution

``````def differenceS1S2(s1 , s2):
listDifference = []
for x in s1:
if x not in s2 and x not in listDifference:
listDifference.append(x)
return listDifference

s1 = "Python Programming"
s2 = "Java Programming"
print(differenceS1S2(s1 , s2)) # the output is: ['y', 't', 'h']``````

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 