May-14-2020, 08:46 PM
Hi all,
I have two lists of equal length, and I want to iterate through both lists while performing subtractions.
I tried this with the following but got the error IndexError: list index out of range. Any ideas what I'm getting wrong?
I have two lists of equal length, and I want to iterate through both lists while performing subtractions.
# Consider the lists a = [x, y, z, a, b] # All ints b = [x2, y2, z2, a2, b2] # All ints # Expected result would be x = [x - x2, y - y2... b - b2]
I tried this with the following but got the error IndexError: list index out of range. Any ideas what I'm getting wrong?
machine_levels = [machine_levels[i] - active_recipe[i] for i in machine_levels]