Relational Operator in Python – CBSE Class12
Relational Operator
Relational operators works with nearly all DATA TYPES IN PYTHON such as numbers stings, lists, tuples, etc. There are six types of relational operators, that python provides.
Here in the term RELATIONAL OPERATOR, relation refers to the relationship of value in an expression, thus these operator determines the relationship among different operands
In python programing, there are six relational operators for comparing value. These operators are also called comparison operators.
If the comparison is true, the relational expression results into the Boolean value TRUE otherwise the result comes Boolean value FALSE.
IMPORTANT PRINCIPALS
Relational operator works on the following principles,
1.For numeric type
- 4 and 4.0 will be treated as equal because of removing trailing from 4.0, it becomes equal to 4 only.
- Strings are compared on the basis of lexicographical ordering (ordering of dictionary) i.e., alphabetical order
- Two lists or tuple are equal if they have same elements in the same order
- Boolean true is equivalent to / and Boolean false to 0 for comparison purpose.
For instance, consider the following relational operations given
a = 3, b = 13, p = 3.0
c = ‘n’, d = ‘g’, e = ‘N’,
f = ‘god’, g = ‘God’, h =‘god’, j = ‘God’, k = “Godhouse”,
L = [1,2,3], M = [2,4,6], N = [1,2,3]
O =(1,2,3), P = (2,4,6), Q = (1,2,3)
Why Relational Operators in Python?
In this tutorial, we have learnt about Relational Operators in python for cbse class 11 & 12 and its related concepts according to CBSE syllabus. This topic is 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 Relational Operators in Python.
Exam Time
Chapter : Relational operators
IMPORTANT QUESTIONS : Asked in examinations of Class 12th Computer Science
How many relational Operators Available in python? |
can relational operators used in strings? |
what are six relational operators in python? |
what are relational operators in python with example? |
What are relational and logical operators? |
What is the difference between relational and logical operators 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