Skip to content

Commit f0c9f21

Browse files
committed
Added comment with the reason for some doctest commented.
1 parent fe502f9 commit f0c9f21

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

project_euler/problem_09/sol1.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ def solution():
1818
2. a**2 + b**2 = c**2
1919
3. a + b + c = 1000
2020
21-
#>>> solution()
22-
#31875000
21+
# The code below has been commented due to slow execution affecting Travis.
22+
# >>> solution()
23+
# 31875000
2324
"""
2425
for a in range(300):
2526
for b in range(400):

project_euler/problem_10/sol1.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ def sum_of_primes(n):
4242
def solution(n):
4343
"""Returns the sum of all the primes below n.
4444
45-
#>>> solution(2000000)
46-
#142913828922
45+
# The code below has been commented due to slow execution affecting Travis.
46+
# >>> solution(2000000)
47+
# 142913828922
4748
>>> solution(1000)
4849
76127
4950
>>> solution(5000)

project_euler/problem_10/sol2.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def prime_generator():
3131
def solution(n):
3232
"""Returns the sum of all the primes below n.
3333
34-
#>>> solution(2000000)
35-
#142913828922
34+
# The code below has been commented due to slow execution affecting Travis.
35+
# >>> solution(2000000)
36+
# 142913828922
3637
>>> solution(1000)
3738
76127
3839
>>> solution(5000)

project_euler/problem_12/sol1.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ def solution():
4545
"""Returns the value of the first triangle number to have over five hundred
4646
divisors.
4747
48-
#>>> solution()
49-
#76576500
48+
# The code below has been commented due to slow execution affecting Travis.
49+
# >>> solution()
50+
# 76576500
5051
"""
5152
tNum = 1
5253
i = 1

project_euler/problem_12/sol2.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ def solution():
3939
"""Returns the value of the first triangle number to have over five hundred
4040
divisors.
4141
42-
#>>> solution()
43-
#76576500
42+
# The code below has been commented due to slow execution affecting Travis.
43+
# >>> solution()
44+
# 76576500
4445
"""
4546
return next(
4647
i for i in triangle_number_generator() if count_divisors(i) > 500

project_euler/problem_14/sol1.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def solution(n):
3030
n → n/2 (n is even)
3131
n → 3n + 1 (n is odd)
3232
33-
#>>> solution(1000000)
34-
#{'counter': 525, 'largest_number': 837799}
33+
# The code below has been commented due to slow execution affecting Travis.
34+
# >>> solution(1000000)
35+
# {'counter': 525, 'largest_number': 837799}
3536
>>> solution(200)
3637
{'counter': 125, 'largest_number': 171}
3738
>>> solution(5000)

project_euler/problem_14/sol2.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ def collatz_sequence(n):
4747
def solution(n):
4848
"""Returns the number under n that generates the longest Collatz sequence.
4949
50-
#>>> solution(1000000)
51-
#{'counter': 525, 'largest_number': 837799}
50+
# The code below has been commented due to slow execution affecting Travis.
51+
# >>> solution(1000000)
52+
# {'counter': 525, 'largest_number': 837799}
5253
>>> solution(200)
5354
{'counter': 125, 'largest_number': 171}
5455
>>> solution(5000)

0 commit comments

Comments
 (0)