Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def factors(num):
- the_factors = [ ]
- for number in range(1, (num+1)):
- if num%number==0:
- the_factors.append(number)
- print(the_factors)
- 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