Create an algorithm that raises a number to the 10th power.
I enter the number 2, I get the result 1024.
I enter a number in and the result is 0.
I enter the number 2 and get the result 1024.
Input data: int x`
Intermediate data: int i
Output: int result
x = int(input('Enter a number: '))
result = 1
for i in range(10):
result = x
print (f'Result: (result)')- Enter the number
2
- Enter the number
0
- Enter the number
-2
But you could just do it like that -
result = x ** 10



