program takes 2 integers and then finds how many divisors each integer between the original 2 has. then prints out which number has the highest number of divisors.

any help is appreciated. im just starting to learn this stuff

6 Years
Discussion Span
Last Post by pyTony

well first of all you need to think out how it should work. So, mathematically how do you find the divisors of a number? Then how would you say that in Python? Effort in effort out around here.

Votes + Comments
Proper newbie handling, sensei ;)

days later and i am still stuck on this...

i know i need to use % when doing the divisors but the % confuses me. what is the exact purpose of the %


i got it to take 2 integers and print them as well as all the integers in between...now im just having trouble putting in to see how many divisors each integer has


HINT: % is the shows the remainder so:


so if a number IN THE RANGE OF 1 AND THE GIVEN NUMBER!!!! had a remainder of 1, would it be a divisor? How about if it had a remainder of 0? Now if we wanted to just find out the amount of divisors it had how would we do that? HINT#2: This is likely to be the LENgth of something.

Edited by JoshuaBurleson: n/a


You could also be looking prime factors instead of divisor. Prime factors of 12 are 2, 2 and 3, divisors are 1, 2, 4, 6 and 12. You must be clear what is the request.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.