## Wednesday, September 8, 2021

Solution Exercise 84: python algorithm which determines the list of integers whose tens digit is divisible by 3

#### Exercise 84

96 is an integer whose tens digit is divisible by 3 (property (*)) Given an integer n, write an algorithm in python which returns the list of integers less than or equal to n composed of two digits and checking the property (*)

#### Solution

``````# coding: utf-8
def listDiv3 (n):
# initialization of the list
lDiv3 = []
for i in range (0, n + 1):
# we test if the tens digit q = i//10 is divisible by 3
if (i//10)% 3 == 0 and (i//10) != 0:
lDiv3.append (i)
return lDiv3

# Example
n = 90
print (listDiv3 (n))
# The output is:
#[30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 90]``````

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 