EXPRESSIONS
Expression contains
of identifiers, literals and operators .It is a combination of values,
variables and operators .It consists of operators and operand. If there are
more than one operator present in a expression the precedence decide which
operation will be performed first. There are many types of expression
available in python.
Types of expressions:
- Constant expression
- Arithmetic expression
- Integral expression
- Floating expression
- Relational expression
- Logical expression
- Bitwise expression
- Combinational expression
CONSTANT EXPRESSION
In constant
expression it contains only constant values.
EXAMPLE:
X= 15+1.3
ARITHMETIC EXPRESSION
The arithmetic expression contains all arithmetic operators.
EXAMPLE: Addition
Subtraction
Multiplication
Division
Exponent
INTEGRAL EXPRESSSION
In this type
of expression it produces only the integer values as
result.
EXAMPLE:
25
FLOATING EXPRESSION
In this type of
expression it produces only floating point number as result.
EXAMPLE: 2.6
RELATIONAL EXPRESSION
In this type of expression
,arithmetic expressions are written on both sides of relational
operator .Those arithmetic operators are evaluated first compared to
the relational operator and produce a boolean output.
EXAMPLE:
True
False
LOGICAL EXPRESSION
In this type of expression the outcome
is in boolean values.It specifies one or more conditions.
EXAMPLE: False
True
False
BITWISE EXPRESSION
In this type of expression the
computations are performed at bit level.
EXAMPLE: 3 24
COMBINATIONAL EXPRESSION
In this type of expression different types of
expressions are performed on a single expression.