Please tell me how to write a loop

asked 2021-01-18 17:13:33 +0200

Rama gravatar image
       x=3
    for i in range(x):
 [if(arr[i]==1)]:
  arr[i]=2^(x-i-1)

Hello there please tell me how to set that arr[i] within the for loop, that is going outside of the loop

If array value at a index is 1 I have set it to the power of 2 IDK about this I'm trying for so long. Please help me with this.

Thanks again

edit retag flag offensive close merge delete

Comments

Please set up you loop in a common language. You can write a condition for a term not defined and I do not understand what do you expect of your loop.

Cyrille gravatar imageCyrille ( 2021-01-18 17:25:43 +0200 )edit