79750080

Date: 2025-08-29 09:41:08
Score: 0.5
Natty:
Report link

You can loop the array and use a basic if-statement

array =  [3, 6, -1, 8, 2, -1]
for i in range(len(array )):
    if array[i] != -1:
       array[i] =  array[i] + 2
  
print(array)

Result:

[5, 8, -1, 10, 4, -1]

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Bending Rodriguez