Answer to Question #187304 in Python for Aditya Sharma

Question #187304

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


1
Expert's answer
2021-04-29T15:42:37-0400
tmp = 1
for i in range(21):
    print(tmp)
    tmp *= 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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS