Taddeus Kroes %!s(int64=13) %!d(string=hai) anos
pai
achega
46eb33ea18
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      problem45.py

+ 3 - 3
problem45.py

@@ -3,9 +3,9 @@ def tri(n): return n * (n + 1) / 2
 def pent(n): return n * (3 * n - 1) / 2
 def hexa(n): return n * (2 * n - 1)
 funcs = (tri, pent, hexa)
-
-n = [20] * 3
-vals = [f(20) for f in funcs]
+init = 20
+n = [init] * len(funcs)
+vals = [f(init) for f in funcs]
 
 while len(set(vals)) > 1 or vals[0] == 40755:
     mini = 0