For15. A real number A and an integer N (>0) are given. Find A in the power of N:
\(A^N = A \cdot A \cdot ... \cdot A\)
(The numbers A are multiplied N times).
Solution in Python 3:
import random
N = random.randrange(1,10)
print('N = ', N)
A = random.randrange(-10,10)
print('A = ', A)
P = 1
for i in range(1,N+1):
P *= A
print(i," : ",P)
print("Product = ",P)