a1=[1,3,-9,6,0]# Исходный массив
a2=[]# Новая еба
for i in range(len(a1)):
if a1[i] < 0:
a2.append(-a1[i])
else:
a2.append(a1[i])
# Лучше:
# for v in a1:
# if v < 0: v = -v
# a2.append(v)
print(a2)
YTE9WzEsMywtOSw2LDBdIyDQmNGB0YXQvtC00L3Ri9C5INC80LDRgdGB0LjQsgphMj1bXSMg0J3QvtCy0LDRjyDQtdCx0LAKZm9yIGkgaW4gcmFuZ2UobGVuKGExKSk6CglpZiBhMVtpXSA8IDA6CgkJYTIuYXBwZW5kKC1hMVtpXSkKCWVsc2U6CgkJYTIuYXBwZW5kKGExW2ldKQojINCb0YPRh9GI0LU6CiMgZm9yIHYgaW4gYTE6CiMgCWlmIHYgPCAwOiB2ID0gLXYKIyAJYTIuYXBwZW5kKHYpCnByaW50KGEyKQ==