les diviseurs d’un nombre python

#obtenir tous les diviseurs d'un nombre 'n'
divisor = [d for d in range(1,n+1) if n%d==0]

Here is what the above code is Doing:
1. We create a list called divisor.
2. We iterate over all the numbers from 1 to n+1.
3. We check if n is divisible by the current number.
4. If it is, we add it to the list.
5. We return the list.