Advertisement
clesiomatias

Buscador de divisores

Jul 22nd, 2022 (edited)
1,030
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. def f(n):
  2.     m=2
  3.     z=int(n/2)
  4.     div=[(1,n)]
  5.    
  6.     if n>2 :
  7.         if n%2==0:
  8.             divs.append((2,int(n/2)))
  9.         while z>=m:
  10.             m+=1
  11.             if n%m==0:
  12.                 z=int(n/m)
  13.                 divs.append((m,z))
  14.             else:
  15.                 z=int(n/m)
  16.     return divs            
  17.                
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement