[:] does the same and is minimally faster than .copy()
This commit is contained in:
parent
f9a0472f85
commit
29b0604952
2
day08.py
2
day08.py
@ -45,7 +45,7 @@ def part2(test_mode=False):
|
|||||||
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
|
||||||
|
|
||||||
check_code = my_input.copy()
|
check_code = my_input[:]
|
||||||
if check_command.startswith('nop'):
|
if check_command.startswith('nop'):
|
||||||
check_code[counter] = check_code[counter].replace('nop', 'jmp')
|
check_code[counter] = check_code[counter].replace('nop', 'jmp')
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user