Exercise 71 || Solution

Determine the list of odd divisors of the number 3570 which are multiples of 3 and contained in the interval [500, 2500]

Solution


l = []
n = 3570
# browsing through the integers from 1 to n
for i in range (1, n + 1):
# we select the integers satisfying the conditions of the hypothesis
if (n%i == 0 and i%3 == 0 and i <= 2500 and i>= 500):
# we add the integers checking the hypothesis
l.append (i)
print ("The list that we search is :", l)
# The out put is : The list is: [510, 714, 1785]


Younes Derfoufi
my-courses.net

Leave a Reply