Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Please tell me how to write a loop

       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