Skip to main content

Here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is Highly divisible triangular number - Problem 12Highly divisible triangular number - Problem 12.

Here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is Highly divisible triangular number - Problem 12.

Here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is Highly divisible triangular number - Problem 12.

hereHere is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is https://projecteuler.net/problem=12Highly divisible triangular number - Problem 12.

here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is https://projecteuler.net/problem=12

Here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is Highly divisible triangular number - Problem 12.

Tweeted twitter.com/StackCodeReview/status/871399173375107074
added 68 characters in body
Source Link
user115383
user115383

here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is https://projecteuler.net/problem=12

here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

here is my code:

triangle_numbers = []
number = 0
for i in range(0, 10000):
    number = number+i
    triangle_numbers.append(number)

for number in triangle_numbers:
    number_of_divisors = 1
    for i in range(1, int(number/2)+1):
        if number % i == 0:
            number_of_divisors = number_of_divisors + 1
            if number_of_divisors > 500:
                print("FOUND AT ", number)

It takes forever to return the answer. How do I make it faster? I'm a beginner, so if you could walk me through your answer that would be great!

The challenge that I am doing is https://projecteuler.net/problem=12

edited tags
Link
Peilonrayz
  • 43.5k
  • 7
  • 76
  • 155
Loading
Source Link
user115383
user115383
Loading