The python expressions is a block of python code that is python interpreter should be executed . the python expressions combination od variables or operands and operator value
x=10
y=10
z=x+y # Expression
The types is related to mathematical operators
Expressions | Explanations | Examples |
---|---|---|
Arithmetic Expressions | The Arithmetic expressions is performed some operations operators is + , -, *, /,**,// | x=10 y=5 z=x+y a=x*y b=x-y c=x/y d=x**y e=x//y |
Relational Expressions | The Relational expressions is performed some operations operators is >, <, >=, <=,=,!== | x=10 y=5 x>y x=y x>=y x< x!=y |
Logical Expressions | The Logical expressions is performed some operations operators is &,|,! | x=10 y=5 x>y&x< x!=y |
Assignment Expressions | The Assignment expressions is performed some operations operators is = | x=10 y=5 |
MemberShip Expressions | The Membership expressions is performed some operations operators in and not in | x=[10,20,30] 30 in x 30 not in x |
Identity Expressions | The Identity expressions is performed some operations operators IS and NOT IS | x=10 y=10 x Is y x NOT IS y |