def divisors(n):
large_divisors = []
for i in range(1, int(n**0.5 + 1)):
if n % i == 0:
yield i
if i*i != n:
large_divisors.append(n//i)
for divisor in reversed(large_divisors):
yield divisor
print(list(divisors(100)))
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.