I've the following two arrays:
array1 = [0, 1, 1, 0]
array2 = ['foo', 'bar', 'hello', 'bye']
I want to save into an array the values of array2 that has the index 1in array1.
On the example above, the desired result should be result_array = ['bar', 'hello'].
I've tried something like this, but it's not working.
for i in array1:
if i = 1:
result_array.append(array2[i])
Thanks in advance
if i = 1:is a typo?lists.