Mark Dickinson added the comment:
This has nothing to do with range. The source of indeterminacy is this line in
your code:
for amp_id in amp_programs.keys():
In Python 3.5, the ordering of `amp_programs.keys()` could differ from run to
run. (With Python 3.6 and later, that won't happen
New submission from Sean Moss :
I was doing this year's Advent of Code and found that the following program
produces unstable output when run using the given file as input:
"""
from itertools import permutations
import gc
def runProgram(amp_input, program, counter):
while program[counter]