1# This function returns a list containing all the factors of a ginven parameters n
2def getFactors(n):
3 # Create an empty list for factors
4 factors=[];
5
6 # Loop over all factors
7 for i in range(1, n + 1):
8 if n % i == 0:
9 factors.append(i)
10
11 # Return the list of factors
12 return factors
13
14# Call the function with a given value
15print (getFactors(256))
1#obtenir tous les diviseurs d'un nombre 'n'
2divisor = [d for d in range(1,n+1) if n%d==0]