fork download
  1. a1=[1,3,-9,6,0]# Исходный массив
  2. a2=[]# Новая еба
  3. for i in range(len(a1)):
  4. if a1<0:
  5. a2.append(-a1)
  6. else:
  7. a2.append(a1)
  8. print(a2)
Success #stdin #stdout 0.02s 44632KB
stdin
Standard input is empty
stdout
[[1, 3, -9, 6, 0], [1, 3, -9, 6, 0], [1, 3, -9, 6, 0], [1, 3, -9, 6, 0], [1, 3, -9, 6, 0]]