Académique Documents
Professionnel Documents
Culture Documents
1. Arithmetic Operators
2. Comparison Operators
3. Logical (or Relational) Operators
4. Assignment Operators
5. Conditional (or ternary) Operators
Operator precedence
Operator Description
** Exponentiation (raise to the power)
~ Complement
* / % // Multiply, divide, modulo and floor division
+ - Addition and subtraction
>> << Right and left bitwise shift
& Bitwise 'AND'
^ | Bitwise exclusive `OR' and regular `OR'
<= < > >= Comparison operators
<> == != Equality operators
= %= /= //= -= += *= **= Assignment operators
Example
1. පහත සඳහන් python ප්රsකා ඇගයීමේ නිලැරදි පටිපාටිය ලියා ඒලාමේ සුළුකරන ද පිළිතුර බාගන්න.
i. 20+2**3-8
ii. 10+2*5/4
iii. 25*2**2//3+2
iv. 9.0/4*2**3%3
v. 2**3>>2
2. පහත සඳහන් python ප්රsකායන්හි සුළුකරන ද පිළිතුර බාගන්න.
i. ~45
ii. 25&33
iii. 2**5|12