ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
PYTHON- OPERATORS
CO1: Explain environment, data types, operators used in Python.
Mr. DEEPAK Kumar
Assistant Professor
GNA University
OPERATORS
• Operators are special symbols, combinations of symbols, or
keywords that designate some type of computation. You can
combine objects and operators to build expressions that
perform the actual computation.
• an operator is usually a symbol or combination of symbols
that allows you to perform a specific operation. This operation
can act on one or more operands.
• If the operation involves a single operand, then the operator
is unary. If the operator involves two operands, then the
operator is binary.
TYPES OF OPERATORS IN PYTHON
1. Arithmetic Operators
2. Assignment Operators
3. Comparison Operators
4. Logical Operators
5. Bitwise Operators
6. Membership Operators
7. Identity Operators
1. Arithmetic Operators:
Arithmetic operators are used for performing
mathematical operations and are those operators that
allow you to perform arithmetic operations on numeric
values. OPERATORS SYMBOL MEANING
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder / Modulus
** Exponent
// Floor Division
Exponentiation is a mathematical operation that involves
raising a base number to the power of an exponent.
Exponentiation is done using the ** operator
Example:
23=2×2×2=8
result = 2 ** 3
print(result) # Output: 8
Floor Division
Floor division is a division operation that divides two numbers
and rounds down the result to the nearest integer.
floor division is done using the // operator
Example:
7÷2=3.57
Floor division: 7 // 2=3
result = 7 // 2
print(result) # Output: 3
2. Assignment Operators :
The assignment operator is one of the most
frequently used operators in Python. The
operator consists of a single equal sign (=).
it operates on two operands.
The left-hand operand is typically a Variable,
while the right-hand operand is an expression.
number = 42
day = "Friday"
digits = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
letters = ["a", "b", "c"]
3. Relational or Comparison Operators:
Comparison operators are used to compare Numerical
values and return True or False.
The comparison operators are all binary. This means
that they require left and right operands. These
operators always return a Boolean value (True or False)
that depends on the truth value of the comparison at
hand. OPERATORS OPERATIONS SYNTAX
== Equal to X == Y
!= Not Equal to X != Y
< Less than X < Y
<= Less than or equal to X <= Y
> Greater than X >Y
>= Greater than or
equal to
X >= Y
4. Logical Operators:
Logical operators are used to perform logical operations on
Boolean values. They allow you to combine or manipulate the
results of comparisons.
OPERATORS SYNTAX DESCRIPTION EXAMPLES
And X and Y This returns True
if both x and y are true
x = 10
x > 5 and x < 15
Or X or Y This returns True
if either x or y are true
x = 10
x > 5 or x < 15
not not X Reverses a result, so
if something is True ,
not turns it False
x = 10
not(x > 5 and x < 15)
5. Bitwise Operators:
Bitwise operators perform bitwise operations on integers. The
integers are first converted into binary and then operations are
performed on each bit or corresponding pair of bits.
OPERATOR NAME DESCRIPTION SYNTAX
& Bitwise AND
Result bit 1,if both operand bits are
1;otherwise results bit 0. x & y
| Bitwise OR Result bit 1,if any of the operand bit is 1;
otherwise results bit 0. x | y
~ Bitwise NOT inverts individual bits ~x
^ Bitwise XOR
Results bit 1,if any of the operand bit is 1 but
not both, otherwise
results bit 0.
x ^ y
>> Bitwise right shift
The left operand’s value is moved toward
right by the number of bits
specified by the right operand.
x>>
<< Bitwise left shift
The left operand’s value is moved toward
left by the number of bits
specified by the right operand.
x<<
6. Membership Operator :
Membership operators in Python are operators
used to test whether a value exists in a
sequence, such as a list, tuple, or string.
Membership operators are used to test if a
sequence is presented in an object
OPERATOR DESCRIPTION EXAMPLE
in Returns True if a
sequence with the
specified value is
present in the object
x in y
not in Returns True if a
sequence with the
specified value is not
present in the object
x not in y
7. Identity Operator :
Identity operators in Python are used to
compare the memory locations of two objects.
There are two identity operators: is and is not.
These operators return True if the specified
objects have the same memory address, and
False otherwise.
IDENTITY OPERATORS
OPERATOR DESCRIPTION EXAMPLE
is Returns true if both
variables are the same
object
x is y
Return true
is not Returns true if both
variables are not the same
object
x is not y
Return false

More Related Content

Similar to Python Lec-6 Operatorguijjjjuugggggs.pptx (20)

Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
Jaya Kumari
Ìý
Data Types and Operators in Python2.pptx
Data Types and Operators in Python2.pptxData Types and Operators in Python2.pptx
Data Types and Operators in Python2.pptx
priyakanthr
Ìý
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
Ìý
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
ANANT VYAS
Ìý
Python second ppt
Python second pptPython second ppt
Python second ppt
RaginiJain21
Ìý
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
Jasleen Kaur (Chandigarh University)
Ìý
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
Learnbayin
Ìý
Operators
OperatorsOperators
Operators
jayesh30sikchi
Ìý
SPL 6 | Operators in C
SPL 6 | Operators in CSPL 6 | Operators in C
SPL 6 | Operators in C
Mohammad Imam Hossain
Ìý
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentation
kunal kishore
Ìý
lecture4 pgdca.pptx
lecture4 pgdca.pptxlecture4 pgdca.pptx
lecture4 pgdca.pptx
classall
Ìý
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
savitamhaske
Ìý
Operators in java
Operators in javaOperators in java
Operators in java
AbhishekMondal42
Ìý
OCA JAVA - 3 Programming with Java Operators
 OCA JAVA - 3 Programming with Java Operators OCA JAVA - 3 Programming with Java Operators
OCA JAVA - 3 Programming with Java Operators
Fernando Gil
Ìý
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
teach4uin
Ìý
Shubhrat operator &amp; expression
Shubhrat operator &amp; expressionShubhrat operator &amp; expression
Shubhrat operator &amp; expression
Shubhrat Mishra
Ìý
Operators in java By cheena
Operators in java By cheenaOperators in java By cheena
Operators in java By cheena
Chëëñå Båbü
Ìý
Java script operators
Java script operatorsJava script operators
Java script operators
baabtra.com - No. 1 supplier of quality freshers
Ìý
C PRESENTATION.pptx
C PRESENTATION.pptxC PRESENTATION.pptx
C PRESENTATION.pptx
VAIBHAV175947
Ìý
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
İbrahim Kürce
Ìý
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
Jaya Kumari
Ìý
Data Types and Operators in Python2.pptx
Data Types and Operators in Python2.pptxData Types and Operators in Python2.pptx
Data Types and Operators in Python2.pptx
priyakanthr
Ìý
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
FabMinds
Ìý
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
ANANT VYAS
Ìý
Python second ppt
Python second pptPython second ppt
Python second ppt
RaginiJain21
Ìý
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
Learnbayin
Ìý
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentation
kunal kishore
Ìý
lecture4 pgdca.pptx
lecture4 pgdca.pptxlecture4 pgdca.pptx
lecture4 pgdca.pptx
classall
Ìý
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
savitamhaske
Ìý
OCA JAVA - 3 Programming with Java Operators
 OCA JAVA - 3 Programming with Java Operators OCA JAVA - 3 Programming with Java Operators
OCA JAVA - 3 Programming with Java Operators
Fernando Gil
Ìý
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
teach4uin
Ìý
Shubhrat operator &amp; expression
Shubhrat operator &amp; expressionShubhrat operator &amp; expression
Shubhrat operator &amp; expression
Shubhrat Mishra
Ìý
C PRESENTATION.pptx
C PRESENTATION.pptxC PRESENTATION.pptx
C PRESENTATION.pptx
VAIBHAV175947
Ìý
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
İbrahim Kürce
Ìý

Recently uploaded (20)

Principle and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby BasnetPrinciple and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby Basnet
Boby Basnet
Ìý
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
Ìý
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
Ìý
PUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health SystemsPUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health Systems
Jonathan Hallett
Ìý
TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...
TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...
TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...
RizaBedayo
Ìý
How to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 EmployeeHow to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 Employee
Celine George
Ìý
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptxTLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
RizaBedayo
Ìý
Essentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok SonawalaEssentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok Sonawala
Association for Project Management
Ìý
Storytelling instructions...............
Storytelling instructions...............Storytelling instructions...............
Storytelling instructions...............
Alexander Benito
Ìý
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
Ìý
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
Association for Project Management
Ìý
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
Ìý
Computer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network LayerComputer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network Layer
Murugan146644
Ìý
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
Ìý
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
Ìý
Useful environment methods in Odoo 18 - Odoo ºÝºÝߣs
Useful environment methods in Odoo 18 - Odoo ºÝºÝߣsUseful environment methods in Odoo 18 - Odoo ºÝºÝߣs
Useful environment methods in Odoo 18 - Odoo ºÝºÝߣs
Celine George
Ìý
Kaun TALHA quiz Prelims - El Dorado 2025
Kaun TALHA quiz Prelims - El Dorado 2025Kaun TALHA quiz Prelims - El Dorado 2025
Kaun TALHA quiz Prelims - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
Ìý
How to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 InventoryHow to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 Inventory
Celine George
Ìý
How to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of SaleHow to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of Sale
Celine George
Ìý
How to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣs
How to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣsHow to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣs
How to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣs
Celine George
Ìý
Principle and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby BasnetPrinciple and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby Basnet
Boby Basnet
Ìý
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
Ìý
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
Ìý
PUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health SystemsPUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health Systems
Jonathan Hallett
Ìý
TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...
TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...
TLE 7 - 3rd Topic - Hand Tools, Power Tools, Instruments, and Equipment Used ...
RizaBedayo
Ìý
How to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 EmployeeHow to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 Employee
Celine George
Ìý
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptxTLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
RizaBedayo
Ìý
Storytelling instructions...............
Storytelling instructions...............Storytelling instructions...............
Storytelling instructions...............
Alexander Benito
Ìý
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
Ìý
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
Association for Project Management
Ìý
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
Ìý
Computer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network LayerComputer Network Unit IV - Lecture Notes - Network Layer
Computer Network Unit IV - Lecture Notes - Network Layer
Murugan146644
Ìý
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
Ìý
Useful environment methods in Odoo 18 - Odoo ºÝºÝߣs
Useful environment methods in Odoo 18 - Odoo ºÝºÝߣsUseful environment methods in Odoo 18 - Odoo ºÝºÝߣs
Useful environment methods in Odoo 18 - Odoo ºÝºÝߣs
Celine George
Ìý
How to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 InventoryHow to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 Inventory
Celine George
Ìý
How to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of SaleHow to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of Sale
Celine George
Ìý
How to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣs
How to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣsHow to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣs
How to Setup WhatsApp in Odoo 17 - Odoo ºÝºÝߣs
Celine George
Ìý

Python Lec-6 Operatorguijjjjuugggggs.pptx

  • 1. PYTHON- OPERATORS CO1: Explain environment, data types, operators used in Python. Mr. DEEPAK Kumar Assistant Professor GNA University
  • 2. OPERATORS • Operators are special symbols, combinations of symbols, or keywords that designate some type of computation. You can combine objects and operators to build expressions that perform the actual computation. • an operator is usually a symbol or combination of symbols that allows you to perform a specific operation. This operation can act on one or more operands. • If the operation involves a single operand, then the operator is unary. If the operator involves two operands, then the operator is binary.
  • 3. TYPES OF OPERATORS IN PYTHON 1. Arithmetic Operators 2. Assignment Operators 3. Comparison Operators 4. Logical Operators 5. Bitwise Operators 6. Membership Operators 7. Identity Operators
  • 4. 1. Arithmetic Operators: Arithmetic operators are used for performing mathematical operations and are those operators that allow you to perform arithmetic operations on numeric values. OPERATORS SYMBOL MEANING + Addition - Subtraction * Multiplication / Division % Remainder / Modulus ** Exponent // Floor Division
  • 5. Exponentiation is a mathematical operation that involves raising a base number to the power of an exponent. Exponentiation is done using the ** operator Example: 23=2×2×2=8 result = 2 ** 3 print(result) # Output: 8
  • 6. Floor Division Floor division is a division operation that divides two numbers and rounds down the result to the nearest integer. floor division is done using the // operator Example: 7÷2=3.57 Floor division: 7 // 2=3 result = 7 // 2 print(result) # Output: 3
  • 7. 2. Assignment Operators : The assignment operator is one of the most frequently used operators in Python. The operator consists of a single equal sign (=). it operates on two operands. The left-hand operand is typically a Variable, while the right-hand operand is an expression. number = 42 day = "Friday" digits = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) letters = ["a", "b", "c"]
  • 8. 3. Relational or Comparison Operators: Comparison operators are used to compare Numerical values and return True or False. The comparison operators are all binary. This means that they require left and right operands. These operators always return a Boolean value (True or False) that depends on the truth value of the comparison at hand. OPERATORS OPERATIONS SYNTAX == Equal to X == Y != Not Equal to X != Y < Less than X < Y <= Less than or equal to X <= Y > Greater than X >Y >= Greater than or equal to X >= Y
  • 9. 4. Logical Operators: Logical operators are used to perform logical operations on Boolean values. They allow you to combine or manipulate the results of comparisons. OPERATORS SYNTAX DESCRIPTION EXAMPLES And X and Y This returns True if both x and y are true x = 10 x > 5 and x < 15 Or X or Y This returns True if either x or y are true x = 10 x > 5 or x < 15 not not X Reverses a result, so if something is True , not turns it False x = 10 not(x > 5 and x < 15)
  • 10. 5. Bitwise Operators: Bitwise operators perform bitwise operations on integers. The integers are first converted into binary and then operations are performed on each bit or corresponding pair of bits. OPERATOR NAME DESCRIPTION SYNTAX & Bitwise AND Result bit 1,if both operand bits are 1;otherwise results bit 0. x & y | Bitwise OR Result bit 1,if any of the operand bit is 1; otherwise results bit 0. x | y ~ Bitwise NOT inverts individual bits ~x ^ Bitwise XOR Results bit 1,if any of the operand bit is 1 but not both, otherwise results bit 0. x ^ y >> Bitwise right shift The left operand’s value is moved toward right by the number of bits specified by the right operand. x>> << Bitwise left shift The left operand’s value is moved toward left by the number of bits specified by the right operand. x<<
  • 11. 6. Membership Operator : Membership operators in Python are operators used to test whether a value exists in a sequence, such as a list, tuple, or string. Membership operators are used to test if a sequence is presented in an object OPERATOR DESCRIPTION EXAMPLE in Returns True if a sequence with the specified value is present in the object x in y not in Returns True if a sequence with the specified value is not present in the object x not in y
  • 12. 7. Identity Operator : Identity operators in Python are used to compare the memory locations of two objects. There are two identity operators: is and is not. These operators return True if the specified objects have the same memory address, and False otherwise.
  • 13. IDENTITY OPERATORS OPERATOR DESCRIPTION EXAMPLE is Returns true if both variables are the same object x is y Return true is not Returns true if both variables are not the same object x is not y Return false