kkhhhkk
Coder
I have two lists, we'll call them x and n, I've been trying to write a script that goes through the elements of list n and if they are negative then to change the corresponding index element of x to a positive value
I've tried
However this returns the error out of range, I've also tried:
but this returns the same error
I've tried
Code:
for i in range(0,len(n),1):
if n[i]<0:
x[i] = abs(x[i])
Code:
p=[]
for i in range(0,len(n),1):
if n[i]<0:
p.append(i)
for i in p:
x[p[i]] = abs(x[i])