## Sunday, September 12, 2021

Solution Exercise 89 *: python algorithm which determines the list of integers within a list

#### Exercise 89 *

Given a list L, write a python algorithm which returns the list of digits contained within the elements of list L without repetition. Example if L = ["Python3", 91, "Java2", 95], the algorithm returns the list [3, 9, 1, 2, 5]

#### Solution

``````L = ["Python3", 91, "Java2", 95]
# initialization of the list of digits
list_digit = []

# browse the elements of list L
for word in L:
word = str (word)
# browse the elements of the word string and search for the entire elements
for x in word:
if x.isdigit() and int(x) not in list_digit:
x = int (x)
list_digit.append (x)

print (list_digit)
# The output is: [3, 9, 1, 2, 9, 5]``````

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 