SlideShare a Scribd company logo
2
Most read
4
Most read
5
Most read
Operators in Python
All the operators in Python are classified according to their nature and
type and they are:
• Arithmetic Operators
• Relational Operators
• Logical Operators
• Assignment Operators
• Bitwise Operators
• Boolean Operators
• Membership Operators
• Identity Operators
Arithmetic Operators
• These operators perform basic arithmetic operations like addition,
subtraction, multiplication, division etc. and these operators are
binary operators that means these operators acts on two operands.
And there are 7 binary arithmetic operators available in Python.
Operator Meaning Example Result
+ Addition 10 + 7 12
- Subtraction 10.0 - 1.5 8.5
* Multiplication 30 * 3 900
/ Float Division 5 / 2 2.5
// Integer Division 5 // 2 2
** Exponentiation 3 ** 2 9
% Remainder 10 % 3 1
Operator Priority
Parenthesis (( ), [ ]) First
Exponentiation (**) Second
Multiplication (*), Division (/, //), Modulus (%) Third
Addition (+), Subtraction (-) Fourth
Assignment Fifth
Relational Operators
• Relational operators are used for comparison and the output is either
True or False depending on the values we compare. The following
table shows the list of relational operators with example.
Operator Meaning Example Result
< Less than 5 < 7 True
> Greater than 9 > 5 True
<= Less than equal to 8 <= 8 True
>= Greater than equal
to
7 >= 9 False
== Equal to 10 == 20 False
!= Not equal to 9 != 6 True
Logical Operators
• Logical operators are used to form compound conditions which are a
combination of more than one simple condition. Each of the simple
conditions are evaluated first and based on the result compound
condition is evaluated. The result of the expression is either True or
False based on the result of simple conditions.
Operator Meaning Example Result
and Logical AND (5 > 7) and (3 < 5) False
or Logical OR (7 == 7) or (5 != 5) True
not Logical NOT not(3 <= 2) True
Assignment Operators
• These operators are used to store a value into a variable and also useful to
perform simple arithmetic operations. Assignment operators are of two
types: simple assignment operator and augmented assignment operator.
Simple assignment operators are combined with arithmetic operators to form
augmented assignment operators. The following table shows a list of
assignment operators and its use.
Operator Meaning Example Result
= Simple assignment a = 10 10
+= Addition assignment a = 5
a += 8
13
-= Subtraction assignment b = 5
b -= 8
-3
*= Multiplication assignment a =10
a *= 8
80
/= Float Division assignment a = 10
a /= 8
1.25
//= Integer Division assignment b = 10
b //= 10
1
**= Exponentiation assignment a = 10
a %= 5
0
%= Remainder assignment b = 10
b ** = 8
100000000
Bitwise Operators
• Bitwise Operators acts on individual bits of the operands. These
operators directly act on binary numbers. If we want to use these
operators on integers then first these numbers are converted into
binary numbers and then bitwise operators act on those bits. The
following table shows the list of bitwise operators available in Python.
Operator Meaning Example Result
& Bitwise AND a = 10 = 0000 1010
b = 11 = 0000 1011
a & b = 0000 1010 = 10
a & b = 10
| Bitwise OR a = 10 = 0000 1010
b = 11 = 0000 1011
a | b = 0000 1011 = 11
a | b = 11
^ Bitwise XOR a = 10 = 0000 1010
b = 11 = 0000 1011
a ^ b = 0000 0001 = 1
a ^ b = 1
~ Bitwise Complement a = 10 = 0000 1010
~a = 1111 0101 = -11
~a = -11
<< Bitwise Left Shift a = 10
a << 2 = 40
a << 2 = 40
>> Bitwise Right Shift a = 10
a >> 2 = 2
a >> 2 = 2
Boolean Operators
• There are three boolean operators that act on bool type
literals and provide bool type output. The result of the
boolean operators are either True or False.
Operator Meaning Example Result
and Boolean
AND
a = True, b = False
a and b = True and
False
a and b = False
or Boolean OR a = True, b = False
a or b = True or
False
a or b = True
not Boolean
NOT
a = True
not a = not True
not a = False
Membership Operators
There are two membership operators in Python that are useful to test for
membership in a sequence.
• in: This operator returns True if an element is found in the specified
sequence, otherwise it returns False.
• not in: This operator returns True if any element is not found in the
sequence, otherwise it returns True.
Identity Operators
These operators are used to compare the memory locations of two objects.
Therefore it is possible to verify whether the two objects are same or not. In
Python id() function gives the memory location of an object. Example id(a)
returns the identity number or memory location of object a. There are two
identity operators available in Python. They are
• is: This operator is used to compare the memory location of two objects. If
they are same then it returns True, otherwise returns False.
• is not: This operator returns True if the memory locations of two objects are
not same.If they are same then it returns False.
Operator Precedence and Associativity
• An expression may contain several operators and the order in which
these operators are executed in sequence is called operator
precedence. The following table summarizes the operators in
descending order of their precedence.
Operator Name Precedence
( ) Parenthesis 1st
** Exponentiation 2nd
-, ~ Unary minus, bitwise complement 3rd
*, /, //, % Multiplication, Division, Floor Division, Modulus 4th
+, - Addition, Subtraction 5th
<<, >> Bitwise left shift, bitwise right shift 6th
& Bitwise AND 7th
^ Bitwise XOR 8th
| Bitwise OR 9th
>, >=, <, <=, = =, != Relational Operators 10th
=, %=, /=, //=, -=, +=, *=, **= Assignment Operators 11th
is, is not Identity Operators 12th
in, not in Membership Operators 13th
not Logical NOT 14th
or Logical OR 15th
and Logical AND 16th
Single Line and Multiline Comments
• There are two types of comments used in Python:
• Single Line Comments: These are created simply by starting a line with the hash
character (#), and they are automatically terminated by the end of line. If a line
using the hash character (#) is written after the Python statement, then it is
known as inline comment.
• Multiline Comments: When multiple lines are used as comment lines, then
writing hash character (#) in the beginning of every line is a tedious task. So
instead of writing # character in the beginning of every line, we can enclose
multiple comment lines within ''' (triple single quotes) or """ (triple double
quotes). Multi line comments are also known as block comments.
INPUT AND OUTPUT
• The purpose of a computer is to process data and return results.The data
given to the computer is called input. The results returned by the
computer are called output. So, we can say that a computer takes input,
processes that input and produces the output.
Ad

Recommended

Input output statement in C
Input output statement in C
Muthuganesh S
 
Type checking
Type checking
rawan_z
 
Identification test for animal and plant poison
Identification test for animal and plant poison
Simranjit kaur
 
Exclusive gates
Exclusive gates
shubhajitCHATTERJEE2
 
Css Ppt
Css Ppt
Hema Prasanth
 
15 bitwise operators
15 bitwise operators
Ravindra Rathore
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
Forensic audio
Forensic audio
Tejasvi Bhatia
 
Linked list
Linked list
Muhammad Qasim
 
Niveles de ejecución en linux
Niveles de ejecución en linux
ruberush
 
Firing Marks
Firing Marks
Ketan Patil
 
Python-Functions.pptx
Python-Functions.pptx
Karudaiyar Ganapathy
 
Python strings
Python strings
Mohammed Sikander
 
Datatypes in python
Datatypes in python
eShikshak
 
Keyboard presentation.pdf
Keyboard presentation.pdf
arturoraymundo
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
KrishnaMildain
 
Flowcharts and algorithms
Flowcharts and algorithms
Student
 
Queues
Queues
Lovely Professional University
 
Forensic Analysis of Bare Footprint .pptx
Forensic Analysis of Bare Footprint .pptx
PawanMandal8
 
Java Tokens
Java Tokens
Madishetty Prathibha
 
Java compilation
Java compilation
Mike Kucera
 
PYTHON - TKINTER - GUI - PART 1.ppt
PYTHON - TKINTER - GUI - PART 1.ppt
PriyaSoundararajan1
 
Oops practical file
Oops practical file
Ankit Dixit
 
Introduction to Python
Introduction to Python
Mohammed Sikander
 
DIGITAL ELECTRONICS- Logic Gates
DIGITAL ELECTRONICS- Logic Gates
Trinity Dwarka
 
Lexical analyzer
Lexical analyzer
Farzana Aktar
 
List in Python
List in Python
Siddique Ibrahim
 
Stacks Implementation and Examples
Stacks Implementation and Examples
greatqadirgee4u
 
Operators and Expressions in C++
Operators and Expressions in C++
Praveen M Jigajinni
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
 

More Related Content

What's hot (20)

Linked list
Linked list
Muhammad Qasim
 
Niveles de ejecución en linux
Niveles de ejecución en linux
ruberush
 
Firing Marks
Firing Marks
Ketan Patil
 
Python-Functions.pptx
Python-Functions.pptx
Karudaiyar Ganapathy
 
Python strings
Python strings
Mohammed Sikander
 
Datatypes in python
Datatypes in python
eShikshak
 
Keyboard presentation.pdf
Keyboard presentation.pdf
arturoraymundo
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
KrishnaMildain
 
Flowcharts and algorithms
Flowcharts and algorithms
Student
 
Queues
Queues
Lovely Professional University
 
Forensic Analysis of Bare Footprint .pptx
Forensic Analysis of Bare Footprint .pptx
PawanMandal8
 
Java Tokens
Java Tokens
Madishetty Prathibha
 
Java compilation
Java compilation
Mike Kucera
 
PYTHON - TKINTER - GUI - PART 1.ppt
PYTHON - TKINTER - GUI - PART 1.ppt
PriyaSoundararajan1
 
Oops practical file
Oops practical file
Ankit Dixit
 
Introduction to Python
Introduction to Python
Mohammed Sikander
 
DIGITAL ELECTRONICS- Logic Gates
DIGITAL ELECTRONICS- Logic Gates
Trinity Dwarka
 
Lexical analyzer
Lexical analyzer
Farzana Aktar
 
List in Python
List in Python
Siddique Ibrahim
 
Stacks Implementation and Examples
Stacks Implementation and Examples
greatqadirgee4u
 

Similar to Operators in Python Arithmetic Operators (20)

Operators and Expressions in C++
Operators and Expressions in C++
Praveen M Jigajinni
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
 
Operators in python
Operators in python
Prabhakaran V M
 
operators and expressions in c++
operators and expressions in c++
sanya6900
 
Python programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
Grade XI - Computer science Data Handling in Python
Grade XI - Computer science Data Handling in Python
vidyuthno1
 
Types of Operators in C
Types of Operators in C
Thesis Scientist Private Limited
 
Operators expressions-and-statements
Operators expressions-and-statements
CtOlaf
 
1 Standard Data types.pptx
1 Standard Data types.pptx
ssuser8e50d8
 
Operators
Operators
Kamran
 
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
PraveenaFppt
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
KalaiVani395886
 
Py-Slides-2.ppt
Py-Slides-2.ppt
TejaValmiki
 
Py-Slides-2.ppt
Py-Slides-2.ppt
AllanGuevarra1
 
03 Operators and expressions
03 Operators and expressions
maznabili
 
Operators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languages
AbhishekGupta692777
 
Operators in Python
Operators in Python
Anusuya123
 
Coper in C
Coper in C
thirumalaikumar3
 
Lecture 05.pptx
Lecture 05.pptx
Mohammad Hassan
 
Python_Module_3_AFkkkkV_Operators-1.pptx
Python_Module_3_AFkkkkV_Operators-1.pptx
tissot723
 
Operators and Expressions in C++
Operators and Expressions in C++
Praveen M Jigajinni
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
 
operators and expressions in c++
operators and expressions in c++
sanya6900
 
Python programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
Grade XI - Computer science Data Handling in Python
Grade XI - Computer science Data Handling in Python
vidyuthno1
 
Operators expressions-and-statements
Operators expressions-and-statements
CtOlaf
 
1 Standard Data types.pptx
1 Standard Data types.pptx
ssuser8e50d8
 
Operators
Operators
Kamran
 
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
hlukj6;lukm,t.mnjhgjukryopkiu;lyk y2.ppt
PraveenaFppt
 
03 Operators and expressions
03 Operators and expressions
maznabili
 
Operators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languages
AbhishekGupta692777
 
Operators in Python
Operators in Python
Anusuya123
 
Python_Module_3_AFkkkkV_Operators-1.pptx
Python_Module_3_AFkkkkV_Operators-1.pptx
tissot723
 
Ad

Recently uploaded (20)

Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
Vitamin and Nutritional Deficiencies.pptx
Vitamin and Nutritional Deficiencies.pptx
Vishal Chanalia
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
June 2025 Progress Update With Board Call_In process.pptx
June 2025 Progress Update With Board Call_In process.pptx
International Society of Service Innovation Professionals
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
HistoPathology Ppt. Arshita Gupta for Diploma
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
Intellectual Property Right (Jurisprudence).pptx
Intellectual Property Right (Jurisprudence).pptx
Vishal Chanalia
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
Vitamin and Nutritional Deficiencies.pptx
Vitamin and Nutritional Deficiencies.pptx
Vishal Chanalia
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
HistoPathology Ppt. Arshita Gupta for Diploma
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
Intellectual Property Right (Jurisprudence).pptx
Intellectual Property Right (Jurisprudence).pptx
Vishal Chanalia
 
Ad

Operators in Python Arithmetic Operators

  • 1. Operators in Python All the operators in Python are classified according to their nature and type and they are: • Arithmetic Operators • Relational Operators • Logical Operators • Assignment Operators • Bitwise Operators • Boolean Operators • Membership Operators • Identity Operators
  • 2. Arithmetic Operators • These operators perform basic arithmetic operations like addition, subtraction, multiplication, division etc. and these operators are binary operators that means these operators acts on two operands. And there are 7 binary arithmetic operators available in Python. Operator Meaning Example Result + Addition 10 + 7 12 - Subtraction 10.0 - 1.5 8.5 * Multiplication 30 * 3 900 / Float Division 5 / 2 2.5 // Integer Division 5 // 2 2 ** Exponentiation 3 ** 2 9 % Remainder 10 % 3 1 Operator Priority Parenthesis (( ), [ ]) First Exponentiation (**) Second Multiplication (*), Division (/, //), Modulus (%) Third Addition (+), Subtraction (-) Fourth Assignment Fifth
  • 3. Relational Operators • Relational operators are used for comparison and the output is either True or False depending on the values we compare. The following table shows the list of relational operators with example. Operator Meaning Example Result < Less than 5 < 7 True > Greater than 9 > 5 True <= Less than equal to 8 <= 8 True >= Greater than equal to 7 >= 9 False == Equal to 10 == 20 False != Not equal to 9 != 6 True
  • 4. Logical Operators • Logical operators are used to form compound conditions which are a combination of more than one simple condition. Each of the simple conditions are evaluated first and based on the result compound condition is evaluated. The result of the expression is either True or False based on the result of simple conditions. Operator Meaning Example Result and Logical AND (5 > 7) and (3 < 5) False or Logical OR (7 == 7) or (5 != 5) True not Logical NOT not(3 <= 2) True
  • 5. Assignment Operators • These operators are used to store a value into a variable and also useful to perform simple arithmetic operations. Assignment operators are of two types: simple assignment operator and augmented assignment operator. Simple assignment operators are combined with arithmetic operators to form augmented assignment operators. The following table shows a list of assignment operators and its use. Operator Meaning Example Result = Simple assignment a = 10 10 += Addition assignment a = 5 a += 8 13 -= Subtraction assignment b = 5 b -= 8 -3 *= Multiplication assignment a =10 a *= 8 80 /= Float Division assignment a = 10 a /= 8 1.25 //= Integer Division assignment b = 10 b //= 10 1 **= Exponentiation assignment a = 10 a %= 5 0 %= Remainder assignment b = 10 b ** = 8 100000000
  • 6. Bitwise Operators • Bitwise Operators acts on individual bits of the operands. These operators directly act on binary numbers. If we want to use these operators on integers then first these numbers are converted into binary numbers and then bitwise operators act on those bits. The following table shows the list of bitwise operators available in Python. Operator Meaning Example Result & Bitwise AND a = 10 = 0000 1010 b = 11 = 0000 1011 a & b = 0000 1010 = 10 a & b = 10 | Bitwise OR a = 10 = 0000 1010 b = 11 = 0000 1011 a | b = 0000 1011 = 11 a | b = 11 ^ Bitwise XOR a = 10 = 0000 1010 b = 11 = 0000 1011 a ^ b = 0000 0001 = 1 a ^ b = 1 ~ Bitwise Complement a = 10 = 0000 1010 ~a = 1111 0101 = -11 ~a = -11 << Bitwise Left Shift a = 10 a << 2 = 40 a << 2 = 40 >> Bitwise Right Shift a = 10 a >> 2 = 2 a >> 2 = 2
  • 7. Boolean Operators • There are three boolean operators that act on bool type literals and provide bool type output. The result of the boolean operators are either True or False. Operator Meaning Example Result and Boolean AND a = True, b = False a and b = True and False a and b = False or Boolean OR a = True, b = False a or b = True or False a or b = True not Boolean NOT a = True not a = not True not a = False
  • 8. Membership Operators There are two membership operators in Python that are useful to test for membership in a sequence. • in: This operator returns True if an element is found in the specified sequence, otherwise it returns False. • not in: This operator returns True if any element is not found in the sequence, otherwise it returns True.
  • 9. Identity Operators These operators are used to compare the memory locations of two objects. Therefore it is possible to verify whether the two objects are same or not. In Python id() function gives the memory location of an object. Example id(a) returns the identity number or memory location of object a. There are two identity operators available in Python. They are • is: This operator is used to compare the memory location of two objects. If they are same then it returns True, otherwise returns False. • is not: This operator returns True if the memory locations of two objects are not same.If they are same then it returns False.
  • 10. Operator Precedence and Associativity • An expression may contain several operators and the order in which these operators are executed in sequence is called operator precedence. The following table summarizes the operators in descending order of their precedence. Operator Name Precedence ( ) Parenthesis 1st ** Exponentiation 2nd -, ~ Unary minus, bitwise complement 3rd *, /, //, % Multiplication, Division, Floor Division, Modulus 4th +, - Addition, Subtraction 5th <<, >> Bitwise left shift, bitwise right shift 6th & Bitwise AND 7th ^ Bitwise XOR 8th | Bitwise OR 9th >, >=, <, <=, = =, != Relational Operators 10th =, %=, /=, //=, -=, +=, *=, **= Assignment Operators 11th is, is not Identity Operators 12th in, not in Membership Operators 13th not Logical NOT 14th or Logical OR 15th and Logical AND 16th
  • 11. Single Line and Multiline Comments • There are two types of comments used in Python: • Single Line Comments: These are created simply by starting a line with the hash character (#), and they are automatically terminated by the end of line. If a line using the hash character (#) is written after the Python statement, then it is known as inline comment. • Multiline Comments: When multiple lines are used as comment lines, then writing hash character (#) in the beginning of every line is a tedious task. So instead of writing # character in the beginning of every line, we can enclose multiple comment lines within ''' (triple single quotes) or """ (triple double quotes). Multi line comments are also known as block comments.
  • 12. INPUT AND OUTPUT • The purpose of a computer is to process data and return results.The data given to the computer is called input. The results returned by the computer are called output. So, we can say that a computer takes input, processes that input and produces the output.