Home > Enterprise >  Length of divisors of big numbers(Runtime Error while trying big numbers)
Length of divisors of big numbers(Runtime Error while trying big numbers)

Time:12-02

Error

Here is question

Why this method works slowly. Is there any fastest way of finding length of divisors

CodePudding user response:

well range function always accepts int as its arguments, but the division inside range function always outputs a float. Try this:

math.ceil(float_number)

because as you range function does not cover the upper-range number. Moreover, you have to include number 1 in your range function as well; that is, change your range function to this:

range(1, n 1)
  • Related