Day 3 Python Operators
Day 3 Python Operators
ARITHMETIC OPERATORS
Python Basic Arithmetic Operators
x = 7, y = 2
Addition: x + y = 9
Subtraction: x - y = 5
Multiplication: x*y = 14
Division: x/y = 3.5
(A+B)2 = A2 + 2*A*B + B2
Python Fundamentals
ASSIGNMENT OPERATORS
Using Variables in Python : Assignment
x = x + 2
we can also write
x += 2
x = x - 2
we can also write
x -= 2
Python Fundamentals
COMPARISION OPERATORS
Comparison Operators
5 == 2 Equality
5 != 2 Non-Equality
LOGICAL OPERATORS
LOGICAL Operators – and, or , not
5 == 5 and 2 < 1 will return False