## Saturday, September 11, 2021

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

#### Exercise 88 *

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

#### Solution

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

# browsing through all elements of the list L
for word in L:
word = str(word)
# browsing through all elements of the 'word' string and search for the entire elements
for x in word:
if x.isdigit ():
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 