I want to increase certain elements in I1 by 1 according to locations specified by T. I present the current and expected outputs.
I1= [17, 19, 30, 31, 34, 46]
T=[1, 5]
New=[i+1 for i in I1 if i in T]
print(New)
The current output is
[]
The expected output is
I1= [17, 20, 30, 31, 34, 47]