Python Forum
How to get all divisors from a number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get all divisors from a number
#4
Keep it nice and simple: divisors = lambda x: [i for i in range(2, x) if x%i==0]
Reply


Messages In This Thread
RE: How to get all divisors from a number - by nilamo - Dec-05-2016, 10:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020