Madhan-Alagarsamy commited on
Commit
bbb3d78
·
verified ·
1 Parent(s): a2b4f78

Upload 1AS.py

Browse files
Files changed (1) hide show
  1. 1AS.py +10 -0
1AS.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ def power(x, n):
2
+ if n == 0:
3
+ return 1
4
+ else:
5
+ return x * power(x, n - 1)
6
+
7
+ x = int(input("Enter the base value x: "))
8
+ n = int(input("Enter the exponential value n: "))
9
+ r = power(x, n)
10
+ print("Result:", r)