SlideShare a Scribd company logo
Mutable and Immutable Data Types
• The following table gives examples of mutable and immutable data
types in Python.
Mutable Data Types Immutable Data Types
list int, long
set float, complex
dict str
tuple
frozenset
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
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
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

More Related Content

Similar to 1 Standard Data types.pptx

L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
L3 operators
L3 operatorsL3 operators
L3 operators
teach4uin
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
Emmanuel Alimpolos
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
Emmanuel Alimpolos
 
Coper in C
Coper in CCoper in C
Coper in C
thirumalaikumar3
 
Python operator, data types.pptx
Python operator, data types.pptxPython operator, data types.pptx
Python operator, data types.pptx
BhumaNagaPavan
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
AllanGuevarra1
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).pptPy-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
KalaiVani395886
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
TejaValmiki
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
AmAn Singh
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
AmAn Singh
 
unit1 python.pptx
unit1 python.pptxunit1 python.pptx
unit1 python.pptx
TKSanthoshRao
 
python operators.ppt
python operators.pptpython operators.ppt
python operators.ppt
ErnieAcuna
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
Munazza-Mah-Jabeen
 
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
ANANT VYAS
 
Java - Operators
Java - OperatorsJava - Operators
Java - Operators
Preethi Nambiar
 
Java 2
Java 2Java 2
Java 2
Preethi Nambiar
 
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
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
Yusuf Ayuba
 
Sc
ScSc

Similar to 1 Standard Data types.pptx (20)

L3 operators
L3 operatorsL3 operators
L3 operators
 
L3 operators
L3 operatorsL3 operators
L3 operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Coper in C
Coper in CCoper in C
Coper in C
 
Python operator, data types.pptx
Python operator, data types.pptxPython operator, data types.pptx
Python operator, data types.pptx
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).pptPy-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
C++ revision add on till now
C++ revision add on till nowC++ revision add on till now
C++ revision add on till now
 
unit1 python.pptx
unit1 python.pptxunit1 python.pptx
unit1 python.pptx
 
python operators.ppt
python operators.pptpython operators.ppt
python operators.ppt
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
 
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
 
Java - Operators
Java - OperatorsJava - Operators
Java - Operators
 
Java 2
Java 2Java 2
Java 2
 
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
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
 
Sc
ScSc
Sc
 

Recently uploaded

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 

Recently uploaded (20)

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 

1 Standard Data types.pptx

  • 1. Mutable and Immutable Data Types • The following table gives examples of mutable and immutable data types in Python. Mutable Data Types Immutable Data Types list int, long set float, complex dict str tuple frozenset
  • 2. 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
  • 3. 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
  • 4. 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
  • 5. 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