Class IX Robotics(Introduction to Data - Programming with Python) Lesson 3 Introduction to Operators Session 2024--25
Class IX Robotics(Introduction to Data - Programming with Python) Lesson 3 Introduction to Operators Session 2024--25
Video Tutorials:
Python Programming Tutorial - Operators | Unary and Binary
Python Programming Tutorial - Arithmetic operators and Relational operators
Python Programming Tutorial - Membership Operators and Boolean operators
Python Programming Tutorial - Precedence and Associativity
Python Operators:
Operators are used to perform operations on variables and values.
Python divides the operators in the following groups:
• Arithmetic operators
• Assignment operators
• Comparison operators
• Logical operators
• Identity operators
• Membership operators
• Bitwise operators
== Equal x == y
!= Not equal x != y
and Returns True if both statements are true x < 5 and x < 10
not Reverse the result, returns False if the result is true Not (x < 5 and x < 10)
Identity operators are used to compare the objects, not if they are equal, but if they are
actually the same object, with the same memory location:
is not Returns True if both variables are not the same x is not y
object
not in Returns True if a sequence with the specified value is not x not in y
present in the object
Python Bitwise Operators
<< Zero fill left shift Shift left by pushing zeros in from the right and let the
leftmost bits fall off
>> Signed right shift Shift right by pushing copies of the leftmost bit in from
the left, and let the rightmost bits fall off