Python Arithmetic Operators - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Python Arithmetic Operators

Python Arithmetic Operators


Arithmetic operators are used to perform arithmetic operations between two operands. It includes +(addition), - (subtraction), *(multiplication), /(divide), %(reminder), //(floor division), and exponent (**).
Consider the following table for a detailed explanation of arithmetic operators.
Operator
Description
+ (Addition)
It is used to add two operands. For example, if a = 20, b = 10 => a+b = 30
- (Subtraction)
It is used to subtract the second operand from the first operand. If the first operand is less than the second operand, the value result negative. For example, if a = 20, b = 10 => a ? b = 10
/ (divide)
It returns the quotient after dividing the first operand by the second operand. For example, if a = 20, b = 10 => a/b = 2
* (Multiplication)
It is used to multiply one operand with the other. For example, if a = 20, b = 10 => a * b = 200
% (reminder)
It returns the reminder after dividing the first operand by the second operand. For example, if a = 20, b = 10 => a%b = 0
** (Exponent)
It is an exponent operator represented as it calculates the first operand power to second operand.
// (Floor division)
It gives the floor value of the quotient produced by dividing the two operands.

Operator
Name
Example
+
Addition
x + y
-
Subtraction
x - y
*
Multiplication
x * y
/
Division
x / y
%
Modulus
x % y
**
Exponentiation
x ** y
//
Floor division
x // y


About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.