def power(a, n):
res = 1
for i in range(abs(n)):
res *= a
if n >= 0:
return res
else:
return 1 / res
print(power(float(input()), int(input())))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def power(a, n):
res = 1
for i in range(abs(n)):
res *= a
if n >= 0:
return res
else:
return 1 / res
print(power(float(input()), int(input())))