SlideShare a Scribd company logo
1 of 17
Download to read offline
Data Types
by
Jyostna Devi Bodapati
Python Programming Specialization
Python Programming – Data Structures
Agenda
▪ Properties of Python Data Types
▪ Python Data Types
▪ Scalar
▪ Sequence
▪ Mapping
▪ Set
Python Programming Specialization
Python Programming – Data Structures
Data Type
Python Programming Specialization
Python Programming – Data Structures
Data Type
▪ Data type determines:
▪ the type of value stored in a variable/object
▪ the operations that can be performed on the data
▪ Ex: s = “Python”
▪ The above statement indicates that s is a string, and it is not valid to perform
operations like arithmetic and bit-wise operations on the variable s
Python Programming Specialization
Python Programming – Data Structures
Data Type
▪ Data type determines:
▪ the type of value stored in a variable/object
▪ the operations that can be performed on the data
▪ Ex: a = 100
▪ The above statement indicates that a is an integer , and it is valid to perform
operations like arithmetic, relational and bit-wise operations on the variable a
Python Programming Specialization
Python Programming – Data Structures
Properties of Python Data Types
Python Programming Specialization
Python Programming – Data Structures
Python Data Types: Property1
▪ Python is a dynamically typed language
▪ Advance Declaration of variables is not required in Python
▪ Depending on the value assigned to the variables, their type is decided
▪ Examples:
▪ >>> a = 10 # int
▪ >>> b = 10.3 # float
▪ >>> c = “Python” # string
▪ >>> d = [10, 20, 30, 40] # list
Python Programming Specialization
Python Programming – Data Structures
Python Data Types: Property2
▪ Type of the variable can be changed during the execution
▪ Examples:
▪ >>> x = 5 # int
▪ >>> x = 0.3 # float
▪ >>> x = “Hello python” # string
▪ >>> x = ( 1, 2, 3, 4 ) # tuple
▪ Note: A variable can not belong to multiple data types at a time
Python Programming Specialization
Python Programming – Data Structures
Python Data Types: Property3
▪ Every data item is treated as an object in Python
▪ Data types are treated as classes
▪ Variables are the instances (objects) of the classes
▪ Example:
▪ >>> A = 100
100A
object
Variable
Instance of
Integer class
Python Programming Specialization
Python Programming – Data Structures
Python Data Types: Property4
▪ In a weakly typed language a compiler / interpreter will sometimes change the
type of a variable
▪ Ex: “Hello” + 5 is valid in weakly typed languages
▪ Such Conversions are not valid in Python
▪ Python is a strongly typed language
▪ Unexpected changes to value/variable type is not valid in Python
▪ Ex: “Hello” + 5 #invalid
Python Programming Specialization
Python Programming – Data Structures
Python Data Types: Properties
▪ Python is a dynamically typed language
▪ Data type of a Variable can be changed during execution
▪ Python Data types are classes
▪ Python is a strongly typed language
Python Programming Specialization
Python Programming – Data Structures
Getting the data type
Python Programming Specialization
Python Programming – Data Structures
Python Data Types: type()
▪ Method type() returns the type of an object
▪ Example:
▪ >>> A = 100
▪ >>> print( type ( A ) )
▪ Output: <class 'int'>
Python Programming Specialization
Python Programming – Data Structures
Python Data Types
Python Programming Specialization
Python Programming – Data Structures
Python Data Types
▪ Python supports numerous data types to support storing variety of data
Data Types
Scalar Sequence Mapping Set
Python Programming Specialization
Python Programming – Data Structures
Python Data Types
Data Types
Scalar Data
int
float
complex
boolean
Sequence Data
List
Tuple
String
Mapping Type
Dictionary
Set Type
Set
Frozen Set
Python Data types properties

More Related Content

What's hot

Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011François Scharffe
 
Rdf Overview Presentation
Rdf Overview PresentationRdf Overview Presentation
Rdf Overview PresentationKen Varnum
 
SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudRichard Cyganiak
 
The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)Myungjin Lee
 
Semantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynkSemantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynkNamgee Lee
 
Debunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsDebunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsNeo4j
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFSNilesh Wagmare
 
Efficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF DatabasesEfficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF DatabasesAlexandra Roatiș
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2Dimitris Kontokostas
 
Presentation of OpenNLP
Presentation of OpenNLPPresentation of OpenNLP
Presentation of OpenNLPRobert Viseur
 
Semantic Web - Visa Project
Semantic Web - Visa ProjectSemantic Web - Visa Project
Semantic Web - Visa ProjectAnas Bouzoubaa
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphsandyseaborne
 

What's hot (20)

Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
 
Rdf Overview Presentation
Rdf Overview PresentationRdf Overview Presentation
Rdf Overview Presentation
 
SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data Mud
 
The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)The Semantic Web #9 - Web Ontology Language (OWL)
The Semantic Web #9 - Web Ontology Language (OWL)
 
Semantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynkSemantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynk
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
 
Debunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsDebunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative Facts
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
 
Efficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF DatabasesEfficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF Databases
 
Data quality in Real Estate
Data quality in Real EstateData quality in Real Estate
Data quality in Real Estate
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
What's New in RDF 1.1?
What's New in RDF 1.1?What's New in RDF 1.1?
What's New in RDF 1.1?
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
 
Rdf
RdfRdf
Rdf
 
Presentation of OpenNLP
Presentation of OpenNLPPresentation of OpenNLP
Presentation of OpenNLP
 
Semantic Web - Visa Project
Semantic Web - Visa ProjectSemantic Web - Visa Project
Semantic Web - Visa Project
 
Data in RDF
Data in RDFData in RDF
Data in RDF
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
 

Similar to Python Data types properties

Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python ProgrammingKamal Acharya
 
Numeric Data types in Python
Numeric Data types in PythonNumeric Data types in Python
Numeric Data types in Pythonjyostna bodapati
 
Python Sequence Data types in Brief
Python Sequence Data types in BriefPython Sequence Data types in Brief
Python Sequence Data types in Briefjyostna bodapati
 
chapter-1-review-of-python-basics-copy.pdf
chapter-1-review-of-python-basics-copy.pdfchapter-1-review-of-python-basics-copy.pdf
chapter-1-review-of-python-basics-copy.pdfSangeethManojKumar
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Chariza Pladin
 
modul-python-part1.pptx
modul-python-part1.pptxmodul-python-part1.pptx
modul-python-part1.pptxYusuf Ayuba
 
prakash ppt (2).pdf
prakash ppt (2).pdfprakash ppt (2).pdf
prakash ppt (2).pdfShivamKS4
 
python presentation.pptx
python presentation.pptxpython presentation.pptx
python presentation.pptxNightTune44
 
introduction to python
 introduction to python introduction to python
introduction to pythonJincy Nelson
 
Introduction to Python programming Language
Introduction to Python programming LanguageIntroduction to Python programming Language
Introduction to Python programming LanguageMansiSuthar3
 
PYTHON by kunal.pptx
PYTHON by kunal.pptxPYTHON by kunal.pptx
PYTHON by kunal.pptxkunalGoyal89
 
Chapter7-Introduction to Python.pptx
Chapter7-Introduction to Python.pptxChapter7-Introduction to Python.pptx
Chapter7-Introduction to Python.pptxlemonchoos
 

Similar to Python Data types properties (20)

Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
Python 01.pptx
Python 01.pptxPython 01.pptx
Python 01.pptx
 
Python Programming 1.pptx
Python Programming 1.pptxPython Programming 1.pptx
Python Programming 1.pptx
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
Numeric Data types in Python
Numeric Data types in PythonNumeric Data types in Python
Numeric Data types in Python
 
Python Sequence Data types in Brief
Python Sequence Data types in BriefPython Sequence Data types in Brief
Python Sequence Data types in Brief
 
Working with jpa
Working with jpaWorking with jpa
Working with jpa
 
chapter-1-review-of-python-basics-copy.pdf
chapter-1-review-of-python-basics-copy.pdfchapter-1-review-of-python-basics-copy.pdf
chapter-1-review-of-python-basics-copy.pdf
 
bhaskars.pptx
bhaskars.pptxbhaskars.pptx
bhaskars.pptx
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
modul-python-part1.pptx
modul-python-part1.pptxmodul-python-part1.pptx
modul-python-part1.pptx
 
prakash ppt (2).pdf
prakash ppt (2).pdfprakash ppt (2).pdf
prakash ppt (2).pdf
 
intro to python.pptx
intro to python.pptxintro to python.pptx
intro to python.pptx
 
Python programming
Python programmingPython programming
Python programming
 
Datatyps in posgresql
Datatyps in posgresqlDatatyps in posgresql
Datatyps in posgresql
 
python presentation.pptx
python presentation.pptxpython presentation.pptx
python presentation.pptx
 
introduction to python
 introduction to python introduction to python
introduction to python
 
Introduction to Python programming Language
Introduction to Python programming LanguageIntroduction to Python programming Language
Introduction to Python programming Language
 
PYTHON by kunal.pptx
PYTHON by kunal.pptxPYTHON by kunal.pptx
PYTHON by kunal.pptx
 
Chapter7-Introduction to Python.pptx
Chapter7-Introduction to Python.pptxChapter7-Introduction to Python.pptx
Chapter7-Introduction to Python.pptx
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 

Python Data types properties

  • 2. Python Programming Specialization Python Programming – Data Structures Agenda ▪ Properties of Python Data Types ▪ Python Data Types ▪ Scalar ▪ Sequence ▪ Mapping ▪ Set
  • 3. Python Programming Specialization Python Programming – Data Structures Data Type
  • 4. Python Programming Specialization Python Programming – Data Structures Data Type ▪ Data type determines: ▪ the type of value stored in a variable/object ▪ the operations that can be performed on the data ▪ Ex: s = “Python” ▪ The above statement indicates that s is a string, and it is not valid to perform operations like arithmetic and bit-wise operations on the variable s
  • 5. Python Programming Specialization Python Programming – Data Structures Data Type ▪ Data type determines: ▪ the type of value stored in a variable/object ▪ the operations that can be performed on the data ▪ Ex: a = 100 ▪ The above statement indicates that a is an integer , and it is valid to perform operations like arithmetic, relational and bit-wise operations on the variable a
  • 6. Python Programming Specialization Python Programming – Data Structures Properties of Python Data Types
  • 7. Python Programming Specialization Python Programming – Data Structures Python Data Types: Property1 ▪ Python is a dynamically typed language ▪ Advance Declaration of variables is not required in Python ▪ Depending on the value assigned to the variables, their type is decided ▪ Examples: ▪ >>> a = 10 # int ▪ >>> b = 10.3 # float ▪ >>> c = “Python” # string ▪ >>> d = [10, 20, 30, 40] # list
  • 8. Python Programming Specialization Python Programming – Data Structures Python Data Types: Property2 ▪ Type of the variable can be changed during the execution ▪ Examples: ▪ >>> x = 5 # int ▪ >>> x = 0.3 # float ▪ >>> x = “Hello python” # string ▪ >>> x = ( 1, 2, 3, 4 ) # tuple ▪ Note: A variable can not belong to multiple data types at a time
  • 9. Python Programming Specialization Python Programming – Data Structures Python Data Types: Property3 ▪ Every data item is treated as an object in Python ▪ Data types are treated as classes ▪ Variables are the instances (objects) of the classes ▪ Example: ▪ >>> A = 100 100A object Variable Instance of Integer class
  • 10. Python Programming Specialization Python Programming – Data Structures Python Data Types: Property4 ▪ In a weakly typed language a compiler / interpreter will sometimes change the type of a variable ▪ Ex: “Hello” + 5 is valid in weakly typed languages ▪ Such Conversions are not valid in Python ▪ Python is a strongly typed language ▪ Unexpected changes to value/variable type is not valid in Python ▪ Ex: “Hello” + 5 #invalid
  • 11. Python Programming Specialization Python Programming – Data Structures Python Data Types: Properties ▪ Python is a dynamically typed language ▪ Data type of a Variable can be changed during execution ▪ Python Data types are classes ▪ Python is a strongly typed language
  • 12. Python Programming Specialization Python Programming – Data Structures Getting the data type
  • 13. Python Programming Specialization Python Programming – Data Structures Python Data Types: type() ▪ Method type() returns the type of an object ▪ Example: ▪ >>> A = 100 ▪ >>> print( type ( A ) ) ▪ Output: <class 'int'>
  • 14. Python Programming Specialization Python Programming – Data Structures Python Data Types
  • 15. Python Programming Specialization Python Programming – Data Structures Python Data Types ▪ Python supports numerous data types to support storing variety of data Data Types Scalar Sequence Mapping Set
  • 16. Python Programming Specialization Python Programming – Data Structures Python Data Types Data Types Scalar Data int float complex boolean Sequence Data List Tuple String Mapping Type Dictionary Set Type Set Frozen Set