Python Operators
Estimated reading: 2 minutes 29 views

βž• Python Arithmetic Operators – Perform Basic Math in Python (2025)


πŸ” What Are Arithmetic Operators in Python?

Arithmetic operators in Python are used to perform basic mathematical operations such as addition, subtraction, multiplication, and division.

These operators work with numeric data types like int, float, and complex.


βž• List of Python Arithmetic Operators

OperatorDescriptionExampleResult
+Addition5 + 38
-Subtraction5 - 32
*Multiplication5 * 315
/Division (float)5 / 22.5
//Floor Division5 // 22
%Modulus (remainder)5 % 21
**Exponentiation2 ** 38

βœ… Examples

a = 10
b = 3

print(a + b)   # 13
print(a - b)   # 7
print(a * b)   # 30
print(a / b)   # 3.333...
print(a // b)  # 3
print(a % b)   # 1
print(a ** b)  # 1000

🧠 Key Notes

  • / always returns a float result, even if the numbers divide evenly.
  • // gives the floor of the result (no decimal part).
  • % is used to find remainders (often used in loops and conditions).
  • ** is used for powers (2 ** 3 means 2 raised to the power 3).

πŸ“Œ Summary – Arithmetic Operators in Python

TaskUse This SymbolSample CodeOutput
Add+5 + 38
Subtract-5 - 32
Multiply*5 * 315
Divide/5 / 22.5
Floor Divide//5 // 22
Modulus%5 % 21
Power**2 ** 38

❓ FAQs – Python Arithmetic Operators

❓ What are arithmetic operators in Python?

Arithmetic operators are symbols used to perform basic math operations like addition, subtraction, multiplication, division, modulus, floor division, and exponentiation.

❓ What’s the difference between / and // in Python?

  • / performs true division and returns a float.
  • // performs floor division and returns the largest whole number less than or equal to the result.

❓ What does the ** operator do in Python?

The ** operator is used for exponentiation (raising a number to a power).
Example: 2 ** 3 results in 8.

❓ What is the % operator used for?

% is the modulus operator. It returns the remainder after division.
Example: 10 % 3 returns 1.

❓ Can arithmetic operators work with floats and integers?

Yes. Python automatically promotes the result to float if any operand is a float.
Example: 5 + 3.0 returns 8.0.


Share Now :

Leave a Reply

Your email address will not be published. Required fields are marked *

Share

Python Arithmetic Operators

Or Copy Link

CONTENTS
Scroll to Top