project-euler-100

[RADIOACTIVE] solutions to the first 100 challenges of project euler
git clone git://git.figbert.com/project-euler-100.git
Log | Files | Refs | README

commit 067fa51f1ea3dac8b2936fb4a19f83203b42243b
parent 72cf9a58e754b2cf6cdeae950da6538a67042ac3
Author: therealFIGBERT <figbertwelner@gmail.com>
Date:   Tue, 11 Feb 2020 13:48:01 -0800

:recycle: Change misnamed variables from 'sum' to 'mult'

Diffstat:
Mproblem011.py | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/problem011.py b/problem011.py @@ -35,10 +35,10 @@ def largest_vertical(lst): for i, _ in enumerate(lst): if i + 4 <= len(lst): for k, _ in enumerate(lst[i]): - vertical_sum = 1 + vertical_mult = 1 for j in range(4): - vertical_sum *= lst[i+j][k] - largest = vertical_sum if vertical_sum > largest else largest + vertical_mult *= lst[i+j][k] + largest = vertical_mult if vertical_mult > largest else largest return largest def largest_horizontal(lst): @@ -46,11 +46,11 @@ def largest_horizontal(lst): for i, _ in enumerate(lst): for k, _ in enumerate(lst[i]): if k + 4 <= len(lst[i]): - horizontal_sum = 1 + horizontal_mult = 1 for j in range(4): - horizontal_sum *= lst[i][k+j] - if horizontal_sum > largest: - largest = horizontal_sum + horizontal_mult *= lst[i][k+j] + if horizontal_mult > largest: + largest = horizontal_mult return largest def largest_diagonal(lst):