I want to print a list of numbers that show exponent of 2 to the 100th power such as 2,4,8,16,32,64,128.... up to the 100th power of two using a FOR loop and printing it. I basically want to multiply 2x2x2...100 times
for i in range(1,101,1): print (i)
2 4 8 16 32 64 128 256 512 etc.. all the way to 2^(100)
Slightly faster
power=2
for i in range(1,101,1):
power*=2
print(power)
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加