SlideShare a Scribd company logo
DATATYPES
and
OPERATORS
What is a data type?
In computer science and computer
programing a data type or simply type
is a classification of data which tells
the compiler or the interpreter how
the programmer intends to use the
data.
 Python supports the following
data types.
 NUMERIC
 STRING
 LISTS
 TUPLES
 DICTIONARIES
 NUMERIC
It includes only number which can be
either integer or decimal.
It is of two types:
1. Integer.
2. Float.
Integer:
 Python allows all the positive and negative
numbers to be used with ‘int’ keyword.
Float:
 It is used to specify fractional numbers with
the keyword ‘float’.
 STRING
 In python it is the collection of characters which is
called string and it can hold any type of known
characters like symbols, numbers, letters etc.
 Example:
a=“hello”
b=“how are you”
print(a+b)
o/p:
hello how are you
 LISTS
 In python lists represents ‘coma’ separated values
between square brackets ‘[ ]’.
Example:
a[1,2,3,4,5,6,7,8,9]
a[1]=50
 TUPLES
 They are also list of values separated by ‘coma’
within parenthesis ‘( )’.
Example:
a(1,2,3,4,5,6,7,8,)
a(1)=30
 DICTIONARIES
It is an ordered set of key : value pairs
within flower bracket’{ }’.
Example:
a{1,2,3,4,5,6,7,8}
a{1}=20
 OPERATORS
Python supports the following operators:
1. Arthematic operators.
2. Rational operators.
3. Logical operators.
 ARTHMATIC OPERATORS
It includes:
+, -, /, %, *, //, ** .
1. /: For the division to get quotient.
2. %: For division to get remainder.
3. //: (Floor division) it is for division.
But the fractional part is ignored.
4. **: It is for power calculation.
 RELATIONAL OPERATORS
 represent ‘nIt includes:
>, <, <=, >=, =, ==, !=.
1. = : It is for assigning the value with the variable.
2. == : It is to compare for exact matching.
3. != : Here,’!’ is to ot’.
Example:
a==5
If a=3 , a=5 (when we substitute)
3==5 (wrong) , 5==5(correct)
 LOGICAL OPERATORS
 It includes ‘and’, ‘or’, ‘not’.
1. And: it is called logical ‘and’ which evaluates to true. If
both the inputs are true other wise false.
2. Or: it is called logical ‘or’ and evaluates to true if any
one of the input is true otherwise false
A B A &
B
0 0 0
0 1 0
1 0 0
1 1 1
A B A or B
0 0 0
0 1 1
1 0 1
1 1 1
3. Not: It is called negation in which
there is only one input and the output is
true if input is false and vise versa.
A ! A
0 1
1 0
 IDENTITY OPERATORS
 In python ‘is’ and ‘is not’ are called identity
operators
 ‘is’ will give the output as true if both the variable
point to the same location, otherwise false.
 ‘is not’ will give the output as true if both the
variables doesn't point to the same
location/otherwise false.
THANK YOU
-BY
AMUKTHA MALYA
AKHILA SATVI
MANISHA DAMA

More Related Content

PDF
C programming | Class 8 | III Term
PPTX
Training presentation vlookup - what it is, and when to use it
PPT
8 if
PDF
Python basic operators
PPTX
If and nested i fs
DOCX
Data types and operators in vb
PPT
Ppt lesson 08
PPTX
22 FP Tree
C programming | Class 8 | III Term
Training presentation vlookup - what it is, and when to use it
8 if
Python basic operators
If and nested i fs
Data types and operators in vb
Ppt lesson 08
22 FP Tree

What's hot (20)

PPT
Excel IF function
PPT
Introduction To Programming
PPTX
Cpu-fundamental of C
PPT
Ppt lesson 07
PPTX
Operators , Functions and Options in VB.NET
PPTX
10 Excel Formulas that will help you in any Job
PPSX
Getting started with c++.pptx
PPTX
Excel Function Training
PPTX
Excel functions
PPT
Shubhrat operator &amp; expression
PPT
Frequently asked questions in c
PPTX
Python Programming | JNTUK | UNIT 1 | Lecture 5
PPT
Frequently asked questions in c
PPTX
Variable, constant, operators and control statement
PDF
Overview of C Language
PDF
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
PPTX
Introduction to C Programming - R.D.Sivakumar
PDF
VLOOKUP Function - Marelen Talavera - Vivacious Analytic
DOC
Data Transformation
PDF
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
Excel IF function
Introduction To Programming
Cpu-fundamental of C
Ppt lesson 07
Operators , Functions and Options in VB.NET
10 Excel Formulas that will help you in any Job
Getting started with c++.pptx
Excel Function Training
Excel functions
Shubhrat operator &amp; expression
Frequently asked questions in c
Python Programming | JNTUK | UNIT 1 | Lecture 5
Frequently asked questions in c
Variable, constant, operators and control statement
Overview of C Language
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Introduction to C Programming - R.D.Sivakumar
VLOOKUP Function - Marelen Talavera - Vivacious Analytic
Data Transformation
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
Ad

Similar to Data types and operators (20)

PPTX
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
PPTX
Python operator, data types.pptx
PPTX
python operators.pptx
PPTX
Python assignment 1 Biswajit Mohapatra.pptx
PDF
Data Handling_XI_Finall for grade 11 cbse board
PPTX
data handling revision.pptx
PPTX
Various datatypes_operators supported in python
PPTX
Class 12 computer. 1 Python intro-1.pptx
PPTX
Python.pptx
PPTX
Python programming language introduction unit
PPTX
Introduction to python programming ( part-1)
PPTX
Grade XI - Computer science Data Handling in Python
PPT
PE1 Module 2.ppt
PPTX
MODULE. .pptx
PPTX
Python PPT2
PDF
Data Handling_XI- All details for cbse board grade 11
PPT
python operators.ppt
PPTX
“Python” or “CPython” is written in C/C+
PPTX
Review old Pygame made using python programming.pptx
PPTX
Introduction to Python for Data Science and Machine Learning
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
Python operator, data types.pptx
python operators.pptx
Python assignment 1 Biswajit Mohapatra.pptx
Data Handling_XI_Finall for grade 11 cbse board
data handling revision.pptx
Various datatypes_operators supported in python
Class 12 computer. 1 Python intro-1.pptx
Python.pptx
Python programming language introduction unit
Introduction to python programming ( part-1)
Grade XI - Computer science Data Handling in Python
PE1 Module 2.ppt
MODULE. .pptx
Python PPT2
Data Handling_XI- All details for cbse board grade 11
python operators.ppt
“Python” or “CPython” is written in C/C+
Review old Pygame made using python programming.pptx
Introduction to Python for Data Science and Machine Learning
Ad

Recently uploaded (20)

PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Structure & Organelles in detailed.
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Pre independence Education in Inndia.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Anesthesia in Laparoscopic Surgery in India
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
master seminar digital applications in india
Lesson notes of climatology university.
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Classroom Observation Tools for Teachers
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Abdominal Access Techniques with Prof. Dr. R K Mishra
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
Complications of Minimal Access Surgery at WLH
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pharma ospi slides which help in ospi learning
Cell Structure & Organelles in detailed.
Microbial disease of the cardiovascular and lymphatic systems
Pharmacology of Heart Failure /Pharmacotherapy of CHF
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pre independence Education in Inndia.pdf

Data types and operators

  • 2. What is a data type? In computer science and computer programing a data type or simply type is a classification of data which tells the compiler or the interpreter how the programmer intends to use the data.
  • 3.  Python supports the following data types.  NUMERIC  STRING  LISTS  TUPLES  DICTIONARIES
  • 4.  NUMERIC It includes only number which can be either integer or decimal. It is of two types: 1. Integer. 2. Float.
  • 5. Integer:  Python allows all the positive and negative numbers to be used with ‘int’ keyword. Float:  It is used to specify fractional numbers with the keyword ‘float’.
  • 6.  STRING  In python it is the collection of characters which is called string and it can hold any type of known characters like symbols, numbers, letters etc.  Example: a=“hello” b=“how are you” print(a+b) o/p: hello how are you
  • 7.  LISTS  In python lists represents ‘coma’ separated values between square brackets ‘[ ]’. Example: a[1,2,3,4,5,6,7,8,9] a[1]=50
  • 8.  TUPLES  They are also list of values separated by ‘coma’ within parenthesis ‘( )’. Example: a(1,2,3,4,5,6,7,8,) a(1)=30
  • 9.  DICTIONARIES It is an ordered set of key : value pairs within flower bracket’{ }’. Example: a{1,2,3,4,5,6,7,8} a{1}=20
  • 10.  OPERATORS Python supports the following operators: 1. Arthematic operators. 2. Rational operators. 3. Logical operators.
  • 11.  ARTHMATIC OPERATORS It includes: +, -, /, %, *, //, ** . 1. /: For the division to get quotient. 2. %: For division to get remainder. 3. //: (Floor division) it is for division. But the fractional part is ignored. 4. **: It is for power calculation.
  • 12.  RELATIONAL OPERATORS  represent ‘nIt includes: >, <, <=, >=, =, ==, !=. 1. = : It is for assigning the value with the variable. 2. == : It is to compare for exact matching. 3. != : Here,’!’ is to ot’. Example: a==5 If a=3 , a=5 (when we substitute) 3==5 (wrong) , 5==5(correct)
  • 13.  LOGICAL OPERATORS  It includes ‘and’, ‘or’, ‘not’. 1. And: it is called logical ‘and’ which evaluates to true. If both the inputs are true other wise false. 2. Or: it is called logical ‘or’ and evaluates to true if any one of the input is true otherwise false A B A & B 0 0 0 0 1 0 1 0 0 1 1 1 A B A or B 0 0 0 0 1 1 1 0 1 1 1 1
  • 14. 3. Not: It is called negation in which there is only one input and the output is true if input is false and vise versa. A ! A 0 1 1 0
  • 15.  IDENTITY OPERATORS  In python ‘is’ and ‘is not’ are called identity operators  ‘is’ will give the output as true if both the variable point to the same location, otherwise false.  ‘is not’ will give the output as true if both the variables doesn't point to the same location/otherwise false.