Advertisement
Blessing988

Untitled

Feb 21st, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def factors(num):
  2.     the_factors = [ ]
  3.     for number in range(1, (num+1)):
  4.         if num%number==0:
  5.             the_factors.append(number)
  6.     print(the_factors)
  7.  
  8. factors(1)  #Example (The argument must be a positive whole number) #Python naturally sorts the number in ascending number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement