👤

Sagot :

Réponse :

Bsr,

def div(N):

   a=1

   L=[]

   while a<=N:

       if N%a==0:

           L.append(a)

       a+=1

   print(L)

Sur la console :

>>> div(15)

[1, 3, 5, 15]

>>> div(60)

[1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60]

>>>

Other Questions

© 2024 IDNLearn. All rights reserved.