Write a python program to execute Exponentiation of a number.

Prathiksaa J G
2 min readJun 5, 2021

To find the power of a number.

PYTHON

Python is the popular programming language and we can surely say that it is the next-generation programming language. In every emerging field of computer science, Python makes its presence without fail.

What is exponentiation?

Exponentiation is a mathematical operation where a value is multiplied number of times with itself.

CONCEPTS INVOLVED:

FUNCTION

A function is a block of code. The statement inside the function will be executed only if it is called.

The date passed inside the function is called Parameters. A function can return those data as a result.

Creating and calling the Function:

Example
Output

Information can be passed into functions as arguments. Arguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma.

In this program we have 2 arguments base and exp.

Example of arguments

If Statement:

If statement will be executed only if the condition is true if the condition is false no output will be shown.

Syntax

FULL CODE:

OUTPUT:

output

To know more about Python programming:

--

--