Operator Associativity in Python-CBSE class11
Operator Associativity
you have learnt that the order of python operator in which an expression having multiple operators can be solved easily, the Operators precedence table will help you to solve these types of expressions through python program.
But what if the expression contains two operator that have the same precedence.
No, problem! in this case associated helps you to determine the order of operators.
Just remember this rule ………………
Almost all operation has left to right associatively except exponentiation (**) in same expression, – the operators on the left is evaluated first and then the operator on the right and so on.
Let’s see some easy examples,
What will be output of of 7*8/5//2
Output = 5.0
and
What will be output of 2**3**4
It will be evaluated as 2**(3**4)
and not (2**3)**4
DEFINITION :- operators associativity is the order in which an expression having multiple operators of same precedence is evaluated and all operation are left associative except exponentiation.
Why Operators Associativity in Python
In this tutorial, we have learnt about Operators Associativity in python for CBSE class 11 & 12 and its related concepts according to CBSE syllabus and these topics are very important to start learning python programing language for beginners of class 11th and 12th.
This tutorial is also useful for Central Board of secondary education (CBSE) student of class 11th and 12th , who opted computer science (Code 083) as an optional subject.
You can check the latest CBSE syllabus for computer science Click here for syllabus OR Click here
UNIT NO. | UNIT NAME | MARKS |
1 | Computational thinking and programming | 40 |
2 | Computer network | 10 |
3 | Database management | 20 |
4 | Practical | 30 |
5 | Total | 100 |
Unit II: Computational Thinking and Programming – 1
According to the syllabus , Unit II Computational Thinking and Programming – 1 has the above concepts for learning related to python Operators Associativity in Python.
Exam Time
Chapter : Operators in Python
IMPORTANT QUESTIONS : Asked in examinations of Class 12th Computer Science
What is operator associativity with example? |
Which operator follows right associative in Python? |
How will you define operator associativity? |
Which operator has associativity from right to left? |
Which of these relational operator has highest operator precedence >= <= ==? |
Which of the following operators has its associativity from right to left in Python? |
Read more
-
structure of module in python
-
arithmetic operators
-
operators in python
-
types of operators
-
logical operators
-
membership operators
-
standard library module
- Identifiers in python