CHAPTER 14 •
PYTHON
Python Arithmetic Operators
Learn operators used for mathematical calculations.
01 What is this?
Learn operators used for mathematical calculations.
02 Syntax
Python Syntax
+ - * / % ** //
03 Example
Python Example
a = 10 b = 3 print(a + b) print(a - b) print(a * b) print(a / b) print(a % b) print(a ** b) print(a // b)
04 Important Points
Python provides several arithmetic operators.
05 Common Mistakes
Remember that / returns a division result while // performs floor division.
06 Real World Use
Arithmetic operators are used in calculators, billing and data processing.
07 Practice This Topic
Now try the example yourself in the AIFA Python Editor.
- Read the example carefully.
- Change the values.
- Run the code.
- Observe the output.
- Try creating your own example.