0% found this document useful (0 votes)
3 views

python9

The document provides an overview of various arithmetic operators in Python, including modulus, exponentiation, and methods for calculating squares and square roots. It includes example code snippets demonstrating the use of these operators. The focus is on how to perform these calculations effectively using Python syntax.

Uploaded by

Prachi More
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

python9

The document provides an overview of various arithmetic operators in Python, including modulus, exponentiation, and methods for calculating squares and square roots. It includes example code snippets demonstrating the use of these operators. The focus is on how to perform these calculations effectively using Python syntax.

Uploaded by

Prachi More
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

7/27/24, 9:01 PM Revolutionizing the Job Market | NxtWave

https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=9b13ad84-b75c-4328-9cd3-0c6751ae6b4d&s_id=03d7cf4f-… 1/4
7/27/24, 9:01 PM Revolutionizing the Job Market | NxtWave

More Arithmetic Operators

Modulus

To find the remainder, we use Modulus operator

a%b

Code
PYTHON

1 print(6 % 3)

Output

Code
PYTHON

1 print(7 % 4)

Output

Exponent

To calculate a power b, we use Exponent Operator

https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=9b13ad84-b75c-4328-9cd3-0c6751ae6b4d&s_id=03d7cf4f-… 2/4
7/27/24, 9:01 PM Revolutionizing the Job Market | NxtWave

**

a ** b

Code
PYTHON

1 print(2 ** 4)

Output

16

Square of a number

We can find the square of a number using the exponent operator by


keeping the exponent as 2.

Code
PYTHON

1 print(5 ** 2)

Output

25

Square root of a number

We can find the square root of a number using the exponent operator to
calculate the square root of a number by keeping the exponent as 0.5

Any number to the power of 0.5 we give the square root value of that
number.

https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=9b13ad84-b75c-4328-9cd3-0c6751ae6b4d&s_id=03d7cf4f-… 3/4
7/27/24, 9:01 PM Revolutionizing the Job Market | NxtWave

Code
PYTHON

1 print(16 ** 0.5)

Output

4.0

https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=9b13ad84-b75c-4328-9cd3-0c6751ae6b4d&s_id=03d7cf4f-… 4/4

You might also like