Answer to Question #185505 in Python for Woyengimiesindo Malati

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
1
Expert's answer
2021-04-29T16:19:56-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS