def divisors(number): dividers = [number] num = int(number * 0.5) for i in range(1,num+1): if(number % i == 0): dividers.append(i) dividers.sort() return dividers
- def divisors(number):
dividers = []for i in range(1,number+1):- dividers = [number]
- num = int(number * 0.5)
- for i in range(1,num+1):
- if(number % i == 0):
- dividers.append(i)
- dividers.sort()
- return dividers