0
Write a simple Python program that displays the following powers of 2, one per line: 2¹ , 2², 2³ , 2^4, 2^5 , 2^6 , 2^7 , 2^
6 Respostas
+ 20
for x in range(1, 10):
print("2 ^", x, "=", 2**x)
+ 4
for i in range(1, 10):
print(2**i)
+ 3
print ("What power of two? ")
x = int (input())
print ("Two to the power of", x, "is", 2**x)
0
for i in range(1, 10):
print(2**i)
0
Please help me answer the question below.
Write a Python program that allows the user to enter any integer value, and displays the value of 2 raised to that power. Your program should function as shown below.
What power of two? 10
Two to the power of 10 is 1024
- 1
Thank to you all