Skip to content

Commit 6c34dab

Browse files
authored
Create pow_solver.py
A python program that helps to solve power of numbers calculations
1 parent 967e5b9 commit 6c34dab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def power (base, exp):
2+
if exp == 0:
3+
return 1
4+
return base * power(base, exp - 1)
5+
base = int(input("Enter the base number: "))
6+
exp = int(input("Enter the exponent: "))
7+
print (power (base, exp))

0 commit comments

Comments
 (0)