Important Notice:

Operators in Python

Operators in Python

18 views 1 min read

Python OperatorsTypeOperatorsExampleArithmetic+ - * / // % **a + bComparison== != > < >= <=a == bLogicaland or nota and bAssignment= += -= *= /=x += 5Bitwise& | ^ ~ << >>a & bIdentityis, is notx is yMembershipin, not inx in listArithmetic Examplesa, b = 10, 3\nprint(a + b) # 13\nprint(a // b) # 3 (integer division)\nprint(a % b) # 1 (remainder)\nprint(a ** b) # 1000 (power)

Related Notes