1.4 KiB
1.4 KiB
title | tags | aliases | |||||||
---|---|---|---|---|---|---|---|---|---|
arithmeticOperators |
|
|
[!note] Math Operators in Python
Python supports standard arithmetic operations:[!example] Operator Table
Operator Description Example Result +
Addition 2 + 3
5
-
Subtraction 5 - 2
3
*
Multiplication 2 * 3
6
/
Division (float) 5 / 2
2.5
//
Floor Division 5 // 2
2
%
Modulo (remainder) 5 % 2
1
**
Exponentiation 2 ** 3
8
[!info]- 🔗 Related Notes
- numericTypes — explains how
int
,float
, andcomplex
values behave- mixedTypeArithmetic — details what happens when combining types like
int + float
- operatorPrecedence — explains the order in which operators are evaluated
- typeConversions — shows how conversions affect arithmetic results
- pythonSyntaxOverview — broad context for where arithmetic fits in Python basics