0% found this document useful (0 votes)
57 views

Arithmetic Operators Comparison Operators 3. Logical (Or Relational) Operators 4. Assignment Operators Conditional (Or Ternary) Operators

The document discusses various Python operators such as arithmetic, comparison, logical, assignment, and conditional operators. It provides examples of operator precedence and examples of Python expressions to evaluate. The examples include arithmetic expressions involving exponents, multiplication, division, bitwise operators, comparison operators, and assignment operators.

Uploaded by

Mangala Semage
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Arithmetic Operators Comparison Operators 3. Logical (Or Relational) Operators 4. Assignment Operators Conditional (Or Ternary) Operators

The document discusses various Python operators such as arithmetic, comparison, logical, assignment, and conditional operators. It provides examples of operator precedence and examples of Python expressions to evaluate. The examples include arithmetic expressions involving exponents, multiplication, division, bitwise operators, comparison operators, and assignment operators.

Uploaded by

Mangala Semage
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Knowledge is Strength Knowledge is Strength Knowledge is Strength Knowledge is Strength Knowledge is

Strength General Certificate of Education (Advance Level) Examination


Information and Communication Technology A n u r a B a n d a r a 20 S

Python language supports following type of operators.

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

You might also like