2026fa_cse160/lecture20261103/lists01/powers.py
2026-11-03 12:49:45 -05:00

11 lines
201 B
Python

powersList = [0,1,2,3,4,5,6,7,8,9,10]
# Try this form
#powersList = range(0,11)
print("The list is ", powersList)
for n in powersList:
powerOfTwo = 2**n
print(f"{n:2d} {powerOfTwo:8d}")