SlideShare a Scribd company logo
1 of 8
Download to read offline
Data Types in Python
Swipe
Data Types in Python
Fundamentals Derived
Integers
Float
Complex
Boolean
String
None
List
Tuple
Range
Bytes
Bytes Arrays
Set
Frozen Set
Dictionary
Suite
Numbers
Sequence
Sequence
Mapping
To convert any number from binary, octal, hexadecimal to
decimal value just assign the value to a variable with
corresponding prefixed and peint it. It will give you decimal
equivalent of that number.
Base conversion
Basic Conversion
Bin(X)
Here argument
(x) can be a
decimal, octal
or hexadecimal
value anything
oct(X)
hex(X)
Data type with one of the two built-in values, True or False.
Boolean objects that are equal to True are truthy (true).
But non-Boolean objects can be evaluated in Boolean
context as well and determined to be true or false. It is
denoted by the class bool.
Boolean
# Python program to
# demonstrate boolean type
print(type(True))
print(type(False))
print(type(True))
Boolean Data Type in Python
Note – True and False with capital ‘T’ and ‘F’ are valid
booleans otherwise python will throw an error.
Boolean in python
True
False
- Except 0 everything is true
- Except empty string
everything is true
True - 1
False - 0
In Python, Strings are arrays of bytes representing
Unicode characters.
A string is a collection of one or more characters put
in a single quote, double-quote or triple quote.
In python there is no character data type, a
character is a string of length one.
It is represented by str class.
Strings in Python
Strings in Python
Strings
Combination of characters
kept inside
single/double/triple quotes.
Triple quotes are used to
-To define multiline string,
-To define docstring.
-To comment multiple
lines.
Indexing - str[index]
Slicing - [start:end:step]
Few basic operation on
string.
-Concatenation.
-Repetition.
Data Types in Python
Mutable vs Immutable Data
type in Python
Stay Tuned with
Topics for next Post

More Related Content

What's hot

Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
Suchit Patel
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
Andrew Raj
 

What's hot (19)

[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes
 
Consider the following C program: int fun(int *i) { *i += 5; return 4; } void...
Consider the following C program: int fun(int *i) { *i += 5; return 4; } void...Consider the following C program: int fun(int *i) { *i += 5; return 4; } void...
Consider the following C program: int fun(int *i) { *i += 5; return 4; } void...
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
Python l3
Python l3Python l3
Python l3
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Flag Waiving
Flag WaivingFlag Waiving
Flag Waiving
 
Data types
Data typesData types
Data types
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
 
Ppt lesson 08
Ppt lesson 08Ppt lesson 08
Ppt lesson 08
 
Ppt lesson 07
Ppt lesson 07Ppt lesson 07
Ppt lesson 07
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
C++
C++C++
C++
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Data types in C
Data types in CData types in C
Data types in C
 
Data type
Data typeData type
Data type
 
Data type
Data typeData type
Data type
 

Similar to Data types in python part 2

Similar to Data types in python part 2 (20)

6031be43a4cf6255acb550cb0c1cf55e.pdf
6031be43a4cf6255acb550cb0c1cf55e.pdf6031be43a4cf6255acb550cb0c1cf55e.pdf
6031be43a4cf6255acb550cb0c1cf55e.pdf
 
Data Types In Python.pptx
Data Types In Python.pptxData Types In Python.pptx
Data Types In Python.pptx
 
Presentation on python data type
Presentation on python data typePresentation on python data type
Presentation on python data type
 
python
pythonpython
python
 
Python Keywords
Python KeywordsPython Keywords
Python Keywords
 
Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11
 
Data types in python
Data types in pythonData types in python
Data types in python
 
types.pdf
types.pdftypes.pdf
types.pdf
 
Python numbers
Python numbersPython numbers
Python numbers
 
L6 - Loops.pptx
L6 - Loops.pptxL6 - Loops.pptx
L6 - Loops.pptx
 
L6 - Loops.pptx
L6 - Loops.pptxL6 - Loops.pptx
L6 - Loops.pptx
 
L5 - Data Types, Keywords.pptx
L5 - Data Types, Keywords.pptxL5 - Data Types, Keywords.pptx
L5 - Data Types, Keywords.pptx
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
 
Object reusability in python
Object reusability in pythonObject reusability in python
Object reusability in python
 
Python-CH01L04-Presentation.pptx
Python-CH01L04-Presentation.pptxPython-CH01L04-Presentation.pptx
Python-CH01L04-Presentation.pptx
 
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
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptxvectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
 
Data types in python
Data types in pythonData types in python
Data types in python
 
LISP: Predicates in lisp
LISP: Predicates in lispLISP: Predicates in lisp
LISP: Predicates in lisp
 

More from Learnbay Datascience

More from Learnbay Datascience (20)

Top data science projects
Top data science projectsTop data science projects
Top data science projects
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

Data types in python part 2

  • 1. Data Types in Python Swipe
  • 2. Data Types in Python Fundamentals Derived Integers Float Complex Boolean String None List Tuple Range Bytes Bytes Arrays Set Frozen Set Dictionary Suite Numbers Sequence Sequence Mapping
  • 3. To convert any number from binary, octal, hexadecimal to decimal value just assign the value to a variable with corresponding prefixed and peint it. It will give you decimal equivalent of that number. Base conversion Basic Conversion Bin(X) Here argument (x) can be a decimal, octal or hexadecimal value anything oct(X) hex(X)
  • 4. Data type with one of the two built-in values, True or False. Boolean objects that are equal to True are truthy (true). But non-Boolean objects can be evaluated in Boolean context as well and determined to be true or false. It is denoted by the class bool. Boolean # Python program to # demonstrate boolean type print(type(True)) print(type(False)) print(type(True))
  • 5. Boolean Data Type in Python Note – True and False with capital ‘T’ and ‘F’ are valid booleans otherwise python will throw an error. Boolean in python True False - Except 0 everything is true - Except empty string everything is true True - 1 False - 0
  • 6. In Python, Strings are arrays of bytes representing Unicode characters. A string is a collection of one or more characters put in a single quote, double-quote or triple quote. In python there is no character data type, a character is a string of length one. It is represented by str class. Strings in Python
  • 7. Strings in Python Strings Combination of characters kept inside single/double/triple quotes. Triple quotes are used to -To define multiline string, -To define docstring. -To comment multiple lines. Indexing - str[index] Slicing - [start:end:step] Few basic operation on string. -Concatenation. -Repetition.
  • 8. Data Types in Python Mutable vs Immutable Data type in Python Stay Tuned with Topics for next Post