List of Arithmetic Operations in Python:
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
- Floor Division: //
- Modulus: %
- Exponential: **
Python Arithmetic Operators Examples
Addition: +
Example:
Output:# Python: Arithmetic Operator: Addition (+) Example number1 = 10; number2 = 20; #Addition sum = number1 + number2; print(sum);
30
Subtraction: -
Example:
Output:# Python: Arithmetic Operator: Subtraction (-) Example number1 = 30; number2 = 20; #Subtraction difference = number1 - number2; print(difference);
10
Multiplication: *
Example:
Output:# Python: Arithmetic Operator: Multiplication (*) Example number1 = 10; number2 = 20; #Multiplication mutiplicationResult = number1 * number2; print(mutiplicationResult);
200
Division: /
Example:
Output:# Python: Arithmetic Operator: Division (/) Example number1 = 20; number2 = 10; #Division divisionResult = number1 / number2; print(divisionResult);
10
Floor Division: //
Output:# Python: Arithmetic Operator: Floor Division (//) Example number1 = 21; number2 = 4; #Floor Division #Using Floor Division you get the rounded nearest whole number as the result. floorDivisionResult = number1 / number2; print(floorDivisionResult);
5
Modulus: %
Output:# Python: Arithmetic Operator: Modulus (%) Example number1 = 10; number2 = 2; #Modulus modulusResult = number1 % number2; print(modulusResult);
0
Exponentiation: **
Output:# Python: Arithmetic Operator: Exponentiation (**) Example number1 = 10; number2 = 5; #Modulus exponentialResult = number1 ** number2; print(exponentialResult);
100000







- tkinter - Hello World! Program
- How to install Python Specific version (3.8, 3.9 or 3.10) using Brew
- How to install SpaCy (NLP Library) on Mac
- Python matplotlib segmentation fault: 11 macOS Big Sur
- How to uninstall pip Python packages
- 3 Ways to find if element is present in a List in Python
- How to Convert Python String to DateTime Object
- Python f-strings Formatted String Literals Syntax and Examples
- Where does brew install python in macOS
- Take input argument from command line in Python Programming
- Advanced print() Function Tutorial and Techniques for Python Developers
- How to add borders to tkinter label text
- Whats new in Python 3.10 Pre-release
- Float built-in function in Python
- List of All 35 Reserved Keywords in Python Programming Language 3.11
- How to check if Key Exists in Python Dictionary?
- Read a file line by line in Python Program
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- What is the Max and Minimum Value of int type in Python?
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- Fix: TypeError: can only concatenate str (not int) to str in Python
- How to take user input from the console in a Python program
- [Fix] TypeError: str object is not callable in Python
- 3 Python program to add two numbers
- How to delete a file using Python code example
- [Microsoft Teams] You're not on Teams yet, but you can set it up for your organization. - Teams
- [Fix] Instant java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Years - Java
- How to mute or disable Twitter Fleet in feeds - Twitter
- How to hide or remove quick launch left navigation from SharePoint Online Modern site page - SharePoint
- SharePoint Server 2016 IT Preview Deprecated Removed features - SharePoint
- What is BTS? What is BTS A.R.M.Y? What is its meaning? - BTS
- Eclipse: Updating Maven Project. Unsupported IClasspathEntry kind=4 - Eclipse
- Install the minimal Linux on Docker (only 5 mb Alpine Linux) - Docker