Guest User

Untitled

a guest
Feb 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. print("Program to list all the divisors from a givin number.")
  2.  
  3. number = int(input("Input a number: "))
  4.  
  5. ans_list = []
  6.  
  7. for i in range(1,number+1):
  8. if (number % i) == 0:
  9. ans_list.append(i)
  10.  
  11.  
  12. print("The list of divisors for", number, "is:", ans_list)
Add Comment
Please, Sign In to add comment