SlideShare a Scribd company logo
MAA UMIYA PATIDAR GIRLS HR. SEC. SCHOOL RAU
SUBMITTED
BY:KRATIKA PATIDAR
MAHAK PATIDAR
SUBMMITED
TO:MRS.MALA PATIDAR
CLASS : 11TH A
 DATA TYPES IN PYTHON
a) PYTHON NUMBER
b) PYTHON LIST
c) PYTHON TUPLE
d) PYTHON STRING
e) PYTHON SET
f) PYTHON DICTIONARY
 Every value in Python has a data type. Since everything
is an object in Python programming, data types are
actually classes and variables are instance (object) of
these classes.
 There are various data types in Python. Some of the
important types are listed below
 Integers, floating point numbers and complex
numbers falls under Python numbers category. They
are defined as int, float and complex class in Python.
 We can use the type() function to know which class a
variable or a value belongs to and the is instance()
function to check if an object belongs to a particular
class
 Integer can be of any length, it is only limited by the
memory available. EXAMPLE: 8 etc .
 A floating point number is accurate up to 15 decimal
places. Integer and floating points are separated by
decimal points. 1 is integer, 1.0 is floating point
number.
 A complex number are of the form a+bj where a and b
are floats and j represents square root of -1 .a is real
part of a number and b is the imaginary part .
Example : 2+3 j etc.
 List is an ordered sequence of items. It is one of the
most used data type in Python and is very flexible. All
the items in a list do not need to be of the same type.
 Items separated by commas are enclosed within
brackets [ ].
 List are mutable, meaning, value of elements of a list
can be altered.
 For example : [“neha”,102,1.1]
 Tuple is an ordered sequence of items same as list.The
only difference is that tuple are immutable. Tuples
once created cannot be modified.
 Tuples are used to write-protect data and are usually
faster than list as it cannot change dynamically.
 It is defined within parentheses () where items are
separated by commas.
 We can use the slicing operator [] to extract items but
we cannot change its value.
 For example: (‘a’, ‘e’, ‘I’, ‘o,’ ‘u’)
 String is sequence of Unicode characters. We can use
single quotes or double quotes to represent strings.
Multi-line strings can be denoted using triple quotes’’’
.
 Like list and tuple, slicing operator [ ] can be used with
string. Strings are immutable .
 for example:“hello world ”etc .
 Set is an unordered collection of unique items. Set is
defined by values separated by comma inside braces{
}.items in a set are not ordered.
 We can perform set operations like union, intersection
on two sets. Set have unique values. They eliminate
duplicates.
 Dictionary is an unordered collection of key-value
pairs.
 It is generally used when we have a huge amount of
data. Dictionaries are optimized for retrieving data.
We must know the key to retrieve the value.
 In Python, dictionaries are defined within braces {}
with each item being a pair in the form key:value. Key
and value can be of any type.
THANK
YOU

More Related Content

What's hot

Strings in Python
Strings in PythonStrings in Python
Strings in Python
Amisha Narsingani
 
Python tuple
Python   tuplePython   tuple
Python tuple
Mohammed Sikander
 
python Function
python Function python Function
python Function
Ronak Rathi
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Python dictionary
Python dictionaryPython dictionary
Python dictionary
eman lotfy
 
Set methods in python
Set methods in pythonSet methods in python
Set methods in python
deepalishinkar1
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
Sujith Kumar
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
amiable_indian
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
Mahender Boda
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
Akhil Kaushik
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
Kamal Acharya
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
baabtra.com - No. 1 supplier of quality freshers
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
 
Exception handling and function in python
Exception handling and function in pythonException handling and function in python
Exception handling and function in python
TMARAGATHAM
 
Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
Praveen M Jigajinni
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Ayshwarya Baburam
 
Python list
Python listPython list
Python list
Mohammed Sikander
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
Tahani Al-Manie
 

What's hot (20)

Strings in Python
Strings in PythonStrings in Python
Strings in Python
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
python Function
python Function python Function
python Function
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Python dictionary
Python dictionaryPython dictionary
Python dictionary
 
Set methods in python
Set methods in pythonSet methods in python
Set methods in python
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
Exception handling and function in python
Exception handling and function in pythonException handling and function in python
Exception handling and function in python
 
Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python list
Python listPython list
Python list
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
 

Similar to Python data type

13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss
AliKhokhar33
 
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdfCOMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
rajkumar2792005
 
Data Types In Python.pptx
Data Types In Python.pptxData Types In Python.pptx
Data Types In Python.pptx
YatharthChaudhary5
 
Chapter - 2.pptx
Chapter - 2.pptxChapter - 2.pptx
Chapter - 2.pptx
MikialeTesfamariam
 
2. Values and Data types in Python.pptx
2. Values and Data types in Python.pptx2. Values and Data types in Python.pptx
2. Values and Data types in Python.pptx
deivanayagamramachan
 
ppt notes python language operators and data
ppt notes python language operators and datappt notes python language operators and data
ppt notes python language operators and data
SukhpreetSingh519414
 
List and tuple in python
List and tuple in pythonList and tuple in python
List and tuple in python
proximaK
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
Ali ٍSattar
 
Data structures in Python
Data structures in PythonData structures in Python
Data structures in Python
MITULJAMANG
 
pythondatatypes.pptx
pythondatatypes.pptxpythondatatypes.pptx
pythondatatypes.pptx
ArchanaAravind1
 
Python Session - 3
Python Session - 3Python Session - 3
Python Session - 3
AnirudhaGaikwad4
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
sunilchute1
 
The Datatypes Concept in Core Python.pptx
The Datatypes Concept in Core Python.pptxThe Datatypes Concept in Core Python.pptx
The Datatypes Concept in Core Python.pptx
Kavitha713564
 
trisha comp ppt.pptx
trisha comp ppt.pptxtrisha comp ppt.pptx
trisha comp ppt.pptx
Tapaswini14
 
11 Unit 1 Chapter 03 Data Handling
11   Unit 1 Chapter 03 Data Handling11   Unit 1 Chapter 03 Data Handling
11 Unit 1 Chapter 03 Data Handling
Praveen M Jigajinni
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
AkshayAggarwal79
 
Computer programming 2 Lesson 5
Computer programming 2  Lesson 5Computer programming 2  Lesson 5
Computer programming 2 Lesson 5
MLG College of Learning, Inc
 
unit 1.docx
unit 1.docxunit 1.docx
unit 1.docx
ssuser2e84e4
 
dataStructuresInPython.pptx
dataStructuresInPython.pptxdataStructuresInPython.pptx
dataStructuresInPython.pptx
YashaswiniChandrappa1
 
Programming in Civil Engineering_UNIT 2_NOTES
Programming in Civil Engineering_UNIT 2_NOTESProgramming in Civil Engineering_UNIT 2_NOTES
Programming in Civil Engineering_UNIT 2_NOTES
Rushikesh Kolhe
 

Similar to Python data type (20)

13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss
 
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdfCOMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
 
Data Types In Python.pptx
Data Types In Python.pptxData Types In Python.pptx
Data Types In Python.pptx
 
Chapter - 2.pptx
Chapter - 2.pptxChapter - 2.pptx
Chapter - 2.pptx
 
2. Values and Data types in Python.pptx
2. Values and Data types in Python.pptx2. Values and Data types in Python.pptx
2. Values and Data types in Python.pptx
 
ppt notes python language operators and data
ppt notes python language operators and datappt notes python language operators and data
ppt notes python language operators and data
 
List and tuple in python
List and tuple in pythonList and tuple in python
List and tuple in python
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
 
Data structures in Python
Data structures in PythonData structures in Python
Data structures in Python
 
pythondatatypes.pptx
pythondatatypes.pptxpythondatatypes.pptx
pythondatatypes.pptx
 
Python Session - 3
Python Session - 3Python Session - 3
Python Session - 3
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
 
The Datatypes Concept in Core Python.pptx
The Datatypes Concept in Core Python.pptxThe Datatypes Concept in Core Python.pptx
The Datatypes Concept in Core Python.pptx
 
trisha comp ppt.pptx
trisha comp ppt.pptxtrisha comp ppt.pptx
trisha comp ppt.pptx
 
11 Unit 1 Chapter 03 Data Handling
11   Unit 1 Chapter 03 Data Handling11   Unit 1 Chapter 03 Data Handling
11 Unit 1 Chapter 03 Data Handling
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
 
Computer programming 2 Lesson 5
Computer programming 2  Lesson 5Computer programming 2  Lesson 5
Computer programming 2 Lesson 5
 
unit 1.docx
unit 1.docxunit 1.docx
unit 1.docx
 
dataStructuresInPython.pptx
dataStructuresInPython.pptxdataStructuresInPython.pptx
dataStructuresInPython.pptx
 
Programming in Civil Engineering_UNIT 2_NOTES
Programming in Civil Engineering_UNIT 2_NOTESProgramming in Civil Engineering_UNIT 2_NOTES
Programming in Civil Engineering_UNIT 2_NOTES
 

More from nuripatidar

Python program
Python programPython program
Python program
nuripatidar
 
Python operators
Python operatorsPython operators
Python operators
nuripatidar
 
Python lists
Python listsPython lists
Python lists
nuripatidar
 
Tuple.py
Tuple.pyTuple.py
Tuple.py
nuripatidar
 
Indian history
Indian historyIndian history
Indian history
nuripatidar
 
Python basic Program
Python basic ProgramPython basic Program
Python basic Program
nuripatidar
 
Python Programme list
Python Programme listPython Programme list
Python Programme list
nuripatidar
 
Chemistry
ChemistryChemistry
Chemistry
nuripatidar
 
Python statements
Python statementsPython statements
Python statements
nuripatidar
 

More from nuripatidar (9)

Python program
Python programPython program
Python program
 
Python operators
Python operatorsPython operators
Python operators
 
Python lists
Python listsPython lists
Python lists
 
Tuple.py
Tuple.pyTuple.py
Tuple.py
 
Indian history
Indian historyIndian history
Indian history
 
Python basic Program
Python basic ProgramPython basic Program
Python basic Program
 
Python Programme list
Python Programme listPython Programme list
Python Programme list
 
Chemistry
ChemistryChemistry
Chemistry
 
Python statements
Python statementsPython statements
Python statements
 

Recently uploaded

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 

Python data type

  • 1. MAA UMIYA PATIDAR GIRLS HR. SEC. SCHOOL RAU SUBMITTED BY:KRATIKA PATIDAR MAHAK PATIDAR SUBMMITED TO:MRS.MALA PATIDAR CLASS : 11TH A
  • 2.  DATA TYPES IN PYTHON a) PYTHON NUMBER b) PYTHON LIST c) PYTHON TUPLE d) PYTHON STRING e) PYTHON SET f) PYTHON DICTIONARY
  • 3.  Every value in Python has a data type. Since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes.  There are various data types in Python. Some of the important types are listed below
  • 4.  Integers, floating point numbers and complex numbers falls under Python numbers category. They are defined as int, float and complex class in Python.  We can use the type() function to know which class a variable or a value belongs to and the is instance() function to check if an object belongs to a particular class
  • 5.  Integer can be of any length, it is only limited by the memory available. EXAMPLE: 8 etc .  A floating point number is accurate up to 15 decimal places. Integer and floating points are separated by decimal points. 1 is integer, 1.0 is floating point number.  A complex number are of the form a+bj where a and b are floats and j represents square root of -1 .a is real part of a number and b is the imaginary part . Example : 2+3 j etc.
  • 6.  List is an ordered sequence of items. It is one of the most used data type in Python and is very flexible. All the items in a list do not need to be of the same type.  Items separated by commas are enclosed within brackets [ ].  List are mutable, meaning, value of elements of a list can be altered.  For example : [“neha”,102,1.1]
  • 7.  Tuple is an ordered sequence of items same as list.The only difference is that tuple are immutable. Tuples once created cannot be modified.  Tuples are used to write-protect data and are usually faster than list as it cannot change dynamically.  It is defined within parentheses () where items are separated by commas.  We can use the slicing operator [] to extract items but we cannot change its value.  For example: (‘a’, ‘e’, ‘I’, ‘o,’ ‘u’)
  • 8.  String is sequence of Unicode characters. We can use single quotes or double quotes to represent strings. Multi-line strings can be denoted using triple quotes’’’ .  Like list and tuple, slicing operator [ ] can be used with string. Strings are immutable .  for example:“hello world ”etc .
  • 9.  Set is an unordered collection of unique items. Set is defined by values separated by comma inside braces{ }.items in a set are not ordered.  We can perform set operations like union, intersection on two sets. Set have unique values. They eliminate duplicates.
  • 10.  Dictionary is an unordered collection of key-value pairs.  It is generally used when we have a huge amount of data. Dictionaries are optimized for retrieving data. We must know the key to retrieve the value.  In Python, dictionaries are defined within braces {} with each item being a pair in the form key:value. Key and value can be of any type.