Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This function accepts a positive whole number and returns a list of all the number's factors in ascending order
- def factors(number):
- factor_list = []
- for i in range (1, number + 1):
- if number % i == 0:
- factor_list.append(i)
- (factor_list.sort())
- return factor_list
- print(factors(81))
- print(factors(25))
- print(factors(60))
- print(factors(1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement