Decode School

Decode School - The School for Problem Solvers
Welcome to My Blog.
Need Assignment / Project Guidance (or) Training in Python?

Python Exponentiation

Python program to calculate Power of a Number

Sample Input 1:

2 3

Sample Output 1 :

8

Program or Solution

					    
							
b=int(input("enter the base:"))
p=int(input("Enter the power:"))
exp=b**p
print("exponentiation : {}".format(exp))

					    
					

Program Explanation

Read two inputs using input() method.

Convert it into integer by int() method.

% operator gives remainder.