SlideShare a Scribd company logo
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-2011
François Scharffe
 
Rdf Overview Presentation
Rdf Overview PresentationRdf Overview Presentation
Rdf Overview Presentation
Ken 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 Mud
Richard 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 bynk
Namgee Lee
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
Frank van Harmelen
 
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
Neo4j
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
Nilesh 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 Databases
Alexandra Roatiș
 
Data quality in Real Estate
Data quality in Real EstateData quality in Real Estate
Data quality in Real Estate
Dimitris Kontokostas
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
Dimitris Kontokostas
 
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?
Richard Cyganiak
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
Holger Knublauch
 
Rdf
RdfRdf
Presentation of OpenNLP
Presentation of OpenNLPPresentation of OpenNLP
Presentation of OpenNLP
Robert Viseur
 
Semantic Web - Visa Project
Semantic Web - Visa ProjectSemantic Web - Visa Project
Semantic Web - Visa Project
Anas Bouzoubaa
 
Data in RDF
Data in RDFData in RDF
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
Jose Emilio Labra Gayo
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
andyseaborne
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
Jose Emilio Labra Gayo
 

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 Programming
Kamal Acharya
 
Python 01.pptx
Python 01.pptxPython 01.pptx
Python 01.pptx
AliMohammadAmiri
 
Python Programming 1.pptx
Python Programming 1.pptxPython Programming 1.pptx
Python Programming 1.pptx
Francis Densil Raj
 
Python Programming
Python ProgrammingPython Programming
Python Programming
Saravanan T.M
 
Numeric Data types in Python
Numeric Data types in PythonNumeric Data types in Python
Numeric Data types in Python
jyostna bodapati
 
Python Sequence Data types in Brief
Python Sequence Data types in BriefPython Sequence Data types in Brief
Python Sequence Data types in Brief
jyostna bodapati
 
Working with jpa
Working with jpaWorking with jpa
Working with jpa
Ondrej Mihályi
 
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
SangeethManojKumar
 
bhaskars.pptx
bhaskars.pptxbhaskars.pptx
bhaskars.pptx
NaveenShankar34
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
Chariza Pladin
 
modul-python-part1.pptx
modul-python-part1.pptxmodul-python-part1.pptx
modul-python-part1.pptx
Yusuf Ayuba
 
prakash ppt (2).pdf
prakash ppt (2).pdfprakash ppt (2).pdf
prakash ppt (2).pdf
ShivamKS4
 
intro to python.pptx
intro to python.pptxintro to python.pptx
intro to python.pptx
UpasnaSharma37
 
Python programming
Python programmingPython programming
Python programming
Ganesh Bhosale
 
computer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdfcomputer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdf
SomnathSaha63
 
Datatyps in posgresql
Datatyps in posgresqlDatatyps in posgresql
python presentation.pptx
python presentation.pptxpython presentation.pptx
python presentation.pptx
NightTune44
 
introduction to python
 introduction to python introduction to python
introduction to python
Jincy Nelson
 
Introduction to Python programming Language
Introduction to Python programming LanguageIntroduction to Python programming Language
Introduction to Python programming Language
MansiSuthar3
 
PYTHON by kunal.pptx
PYTHON by kunal.pptxPYTHON by kunal.pptx
PYTHON by kunal.pptx
kunalGoyal89
 

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
 
computer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdfcomputer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdf
 
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
 

Recently uploaded

Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
Celine George
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 

Recently uploaded (20)

Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 

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