Resolved: doubt in example provided
Hi,
First element for this code should be 0 - please confirm.
0 2 4 8 16 32 64 128 256 512
3 answers ( 1 marked as helpful)
Hi Rajesh!
Thanks for reaching out.
The numbers displayed after executing the loop in Python are correct. 2 to the power of 0 equals 1, not 0. So, the output is indeed correct.
Hope this helps.
Kind regards,
Martin
Dear Martin,
Thanks for the clarity.. I thought 2^0 is 0 - my mistake. Jus rechecked in google too. :)
thanks again
You are very welcome!
Kind regards,
Martin