TIL: enumerate() exists; no more manual counting
This commit is contained in:
parent
aa5ae674ec
commit
b4ff7c58d0
4
day08.py
4
day08.py
@ -37,9 +37,7 @@ def part1(test_mode=False):
|
|||||||
|
|
||||||
def part2(test_mode=False):
|
def part2(test_mode=False):
|
||||||
my_input = aoclib.getInputAsArray(day=DAY, test=test_mode)
|
my_input = aoclib.getInputAsArray(day=DAY, test=test_mode)
|
||||||
counter = -1
|
for counter, check_command in enumerate(my_input):
|
||||||
for check_command in my_input:
|
|
||||||
counter += 1
|
|
||||||
if not check_command.startswith('nop') and not check_command.startswith('jmp'):
|
if not check_command.startswith('nop') and not check_command.startswith('jmp'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user