Question #185505

Write a program that prints all powers of 2 from 20 up to 220.
Output Segment
1
2
4
8
16
:
:
65536
131072
262144
524288
1048576

Expert's answer

n = 1
for i in range(21):
    print(n)
    n *= 2

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS