SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
GVK CHINMAYA VIDYALAYA
SENIOR SECONDARY SCHOOL
Kothuru, Indukurupet, SPS Nellore
Data Handling
Class: 11 Subject: Python Teacher: C Vijaya
In programming, data type is an important concept.
Variables can store data of different types, and different types can do different things.
Python has the following data types built-in by default, in these categories:
Python Data Types
Text Type: str
Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozenset
Boolean Type: bool
Binary Types: bytes, bytearray, memoryview
In Python, the data type is set when you assign a value to a variable:
Python Numbers
There are three numeric types in Python:
● int
● float
● complex
Variables of numeric types are created when you assign a value to them:
Output
String Literals
String literals in python are surrounded by either single quotation marks, or double quotation
marks.
'hello' is the same as "hello".
You can display a string literal with the print() function:
Eg:
a=”hello”
print(a)
Eg:
a=”””Welcome to gvkcv
At Indhukeurpet”””
print(a)
Strings are Arrays
Like many other popular programming languages, strings in Python are arrays of bytes
representing unicode characters.
However, Python does not have a character data type, a single character is simply a string with
a length of 1.
Square brackets can be used to access elements of the string.
Slicing
You can return a range of characters by using the slice syntax.
Specify the start index and the end index, separated by a colon, to return a part of the
string.
String Length
To get the length of a string, use the len() function.
Boolean Values
In programming you often need to know if an expression is True or False.
You can evaluate any expression in Python, and get one of two answers, True or
False.
When you compare two values, the expression is evaluated and Python returns the
Boolean answer:
Dictionary
A dictionary is a collection which is unordered, changeable and indexed. In Python dictionaries
are written with curly brackets, and they have keys and values.
Python Dictionaries
Output
Core Data Types
Every variable in python holds an instance of an object. There are two types of objects in python i.e.
Mutable and Immutable objects. Whenever an object is instantiated, it is assigned a unique object
id. The type of the object is defined at the runtime and it can’t be changed afterwards. However, it’s
state can be changed if it is a mutable object.
To summarise the difference, mutable objects can change their state or contents and immutable
objects can’t change their state or content.
● Immutable Objects : These are of in-built types like int, float, bool, string, unicode, tuple.
In simple words, an immutable object can’t be changed after it is created.
Mutable vs Immutable Objects in Python
Mutable Objects : These are of type list, dict, set . Custom classes are
generally mutable.
Every Python object has three key attributes associated to it
1. The type of an object
2. The value of an object
3. The id of an object
1. The type of an object
The type of an object determines the operations that can be performed on the object.
Built-in function type() returns the type of an object.
2. The value of an object
The value is the literal itself and for a variable the data iis the data-item(the variable) it is
currently referencing. Print statement can display the value of an object.
3 .The id of an object
Id of an object is the memory location of the object.
Truth Value Testing
Value with truth value as false Values with truth value as truth
None
All the other values are
considered true
False (Boolean value False)
Zero for any numeric type,for example 0,0.0,0j
Any empty sequence eg:( ),[ ],
Any empty mapping eg: { }
www.gvkcv.in
The or operator combines two expressions,which make it operands.The or operator works in these
ways:
● Relational expressions as operands
● Numbers or strings or lists as operands
The or operator
Relational expressions as operands:
The or operator evaluates to true if either of its (relational) operands evaluates to True;False if both
operands evaluate to False.
Eg:
(4==4) or (5==8) results into True because first expression is True
5>8 or 5<2 results into False because both expressions are False
Numbers / Strings / list as operands:
In an expression x or y , if first operand has False then return second operand y as result.
Eg:
0 or 0 0 First expression is false so second expression is returned
0 or 8 8 First expression is false so second expression is returned
8 or 0 8 First expression is true hence first expression is returned
“Gvkcv” or “ ” “Gvkcv” First expression is true hence first expression is returned
“ “ or “gvkcv” “gvkcv” First expression is false hence second expression is returned
“ “ or “ “ “ “ First expression is false hence second expression is returned
“Python” or “gvkcv” “Python” First expression is true hence first expression is returned
The and operator:
● Relational expressions as operands
● Numbers or strings or lists as operands
Relational expressions as operands:
The and operator evaluates to True if both of its operands evaluate to True ; False if either or both
operands evaluate to False.
Eg:
(7==7) and (5==7) results False
(2>5) and (5<2) results False
5>2 and 2<5 results True
Numbers or Strings or Lists as operands:
In an expression x and y , if first operand has false then return first operand otherwise return second
operand.
Eg:
0 and 0 0 First expression is false so second expression is returned
0 and 8 0 First expression is false so second expression is returned
8 and 0 0 First expression is true hence first expression is returned
“Gvkcv” and “ ” “” First expression is true hence first expression is returned
“ “ and “gvkcv” “” First expression is false hence second expression is returned
“ “ and “ “ “ “ First expression is false hence second expression is returned
“Python” and “gvkcv” “gvkcv” First expression is true hence first expression is returned
The not operator:
The logical not operator negates or reverse the truth value of the expression.
Eg:
not 5 results into true
not 0 results into true
not -4 results into false
Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11

Mais conteúdo relacionado

Mais procurados (20)

Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
 
11 Unit 1 Problem Solving Techniques
11  Unit 1 Problem Solving Techniques11  Unit 1 Problem Solving Techniques
11 Unit 1 Problem Solving Techniques
 
Python
PythonPython
Python
 
Data Handling
Data HandlingData Handling
Data Handling
 
Python revision tour i
Python revision tour iPython revision tour i
Python revision tour i
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methods
 
Full Python in 20 slides
Full Python in 20 slidesFull Python in 20 slides
Full Python in 20 slides
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Python strings
Python stringsPython strings
Python strings
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 
Python set
Python setPython set
Python set
 
Python revision tour II
Python revision tour IIPython revision tour II
Python revision tour II
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | Edureka
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 

Semelhante a Data handling CBSE PYTHON CLASS 11

data handling revision.pptx
data handling revision.pptxdata handling revision.pptx
data handling revision.pptxDeepaRavi21
 
L6 - Loops.pptx
L6 - Loops.pptxL6 - Loops.pptx
L6 - Loops.pptxEloAOgardo
 
L6 - Loops.pptx
L6 - Loops.pptxL6 - Loops.pptx
L6 - Loops.pptxEloAOgardo
 
L5 - Data Types, Keywords.pptx
L5 - Data Types, Keywords.pptxL5 - Data Types, Keywords.pptx
L5 - Data Types, Keywords.pptxEloAOgardo
 
Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.pptjaba kumar
 
Introduction to Python - Part Two
Introduction to Python - Part TwoIntroduction to Python - Part Two
Introduction to Python - Part Twoamiable_indian
 
UNIT II_python Programming_aditya College
UNIT II_python Programming_aditya CollegeUNIT II_python Programming_aditya College
UNIT II_python Programming_aditya CollegeRamanamurthy Banda
 
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptxchapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptxJahnavi113937
 
Python_Unit_1.pdf
Python_Unit_1.pdfPython_Unit_1.pdf
Python_Unit_1.pdfalaparthi
 
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.pdfrajkumar2792005
 
Literals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersLiterals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersTanishq Soni
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning ParrotAI
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in PythonMSB Academy
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in PythonRaajendra M
 

Semelhante a Data handling CBSE PYTHON CLASS 11 (20)

data handling revision.pptx
data handling revision.pptxdata handling revision.pptx
data handling revision.pptx
 
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
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
 
Introduction to Python - Part Two
Introduction to Python - Part TwoIntroduction to Python - Part Two
Introduction to Python - Part Two
 
Data Types In Python.pptx
Data Types In Python.pptxData Types In Python.pptx
Data Types In Python.pptx
 
UNIT II_python Programming_aditya College
UNIT II_python Programming_aditya CollegeUNIT II_python Programming_aditya College
UNIT II_python Programming_aditya College
 
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptxchapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
chapter-3-engdata-handling1_1585929972520 by EasePDF.pptx
 
Python_Unit_1.pdf
Python_Unit_1.pdfPython_Unit_1.pdf
Python_Unit_1.pdf
 
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
 
Python Keywords
Python KeywordsPython Keywords
Python Keywords
 
Literals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersLiterals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiers
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning
 
python
pythonpython
python
 
Python basics
Python basicsPython basics
Python basics
 
Python slide.1
Python slide.1Python slide.1
Python slide.1
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
 

Mais de chinthala Vijaya Kumar

GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...chinthala Vijaya Kumar
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12chinthala Vijaya Kumar
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21chinthala Vijaya Kumar
 
Inserting an element in a sorted array using traditional algorithm
Inserting an element in a sorted array using traditional algorithmInserting an element in a sorted array using traditional algorithm
Inserting an element in a sorted array using traditional algorithmchinthala Vijaya Kumar
 
Binary search in Python using recursion
Binary search in Python using recursionBinary search in Python using recursion
Binary search in Python using recursionchinthala Vijaya Kumar
 

Mais de chinthala Vijaya Kumar (11)

GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
 
Inserting an element in a sorted array using traditional algorithm
Inserting an element in a sorted array using traditional algorithmInserting an element in a sorted array using traditional algorithm
Inserting an element in a sorted array using traditional algorithm
 
Binary search in Python using recursion
Binary search in Python using recursionBinary search in Python using recursion
Binary search in Python using recursion
 
Linear search python CBSE Class 12
Linear search python CBSE Class 12Linear search python CBSE Class 12
Linear search python CBSE Class 12
 
Data visualization pyplot
Data visualization pyplotData visualization pyplot
Data visualization pyplot
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
Python Fundamentals Class 11
Python Fundamentals Class 11Python Fundamentals Class 11
Python Fundamentals Class 11
 
File handling CBSE CLASS 12
File handling CBSE CLASS 12File handling CBSE CLASS 12
File handling CBSE CLASS 12
 
Recursion CBSE Class 12
Recursion CBSE Class 12Recursion CBSE Class 12
Recursion CBSE Class 12
 

Último

Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
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.pdfPoh-Sun Goh
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
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.pptxMaritesTamaniVerdade
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
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.christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 

Último (20)

Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
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
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
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
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
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.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

Data handling CBSE PYTHON CLASS 11

  • 1. GVK CHINMAYA VIDYALAYA SENIOR SECONDARY SCHOOL Kothuru, Indukurupet, SPS Nellore Data Handling Class: 11 Subject: Python Teacher: C Vijaya
  • 2. In programming, data type is an important concept. Variables can store data of different types, and different types can do different things. Python has the following data types built-in by default, in these categories: Python Data Types Text Type: str Numeric Types: int, float, complex Sequence Types: list, tuple, range Mapping Type: dict Set Types: set, frozenset Boolean Type: bool Binary Types: bytes, bytearray, memoryview
  • 3. In Python, the data type is set when you assign a value to a variable:
  • 4. Python Numbers There are three numeric types in Python: ● int ● float ● complex Variables of numeric types are created when you assign a value to them:
  • 6. String Literals String literals in python are surrounded by either single quotation marks, or double quotation marks. 'hello' is the same as "hello". You can display a string literal with the print() function: Eg: a=”hello” print(a) Eg: a=”””Welcome to gvkcv At Indhukeurpet””” print(a)
  • 7. Strings are Arrays Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters. However, Python does not have a character data type, a single character is simply a string with a length of 1. Square brackets can be used to access elements of the string.
  • 8.
  • 9. Slicing You can return a range of characters by using the slice syntax. Specify the start index and the end index, separated by a colon, to return a part of the string.
  • 10.
  • 11. String Length To get the length of a string, use the len() function.
  • 12. Boolean Values In programming you often need to know if an expression is True or False. You can evaluate any expression in Python, and get one of two answers, True or False. When you compare two values, the expression is evaluated and Python returns the Boolean answer:
  • 13.
  • 14.
  • 15. Dictionary A dictionary is a collection which is unordered, changeable and indexed. In Python dictionaries are written with curly brackets, and they have keys and values. Python Dictionaries
  • 18. Every variable in python holds an instance of an object. There are two types of objects in python i.e. Mutable and Immutable objects. Whenever an object is instantiated, it is assigned a unique object id. The type of the object is defined at the runtime and it can’t be changed afterwards. However, it’s state can be changed if it is a mutable object. To summarise the difference, mutable objects can change their state or contents and immutable objects can’t change their state or content. ● Immutable Objects : These are of in-built types like int, float, bool, string, unicode, tuple. In simple words, an immutable object can’t be changed after it is created. Mutable vs Immutable Objects in Python
  • 19.
  • 20.
  • 21. Mutable Objects : These are of type list, dict, set . Custom classes are generally mutable.
  • 22. Every Python object has three key attributes associated to it 1. The type of an object 2. The value of an object 3. The id of an object
  • 23. 1. The type of an object The type of an object determines the operations that can be performed on the object. Built-in function type() returns the type of an object.
  • 24. 2. The value of an object The value is the literal itself and for a variable the data iis the data-item(the variable) it is currently referencing. Print statement can display the value of an object.
  • 25. 3 .The id of an object Id of an object is the memory location of the object.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. Truth Value Testing Value with truth value as false Values with truth value as truth None All the other values are considered true False (Boolean value False) Zero for any numeric type,for example 0,0.0,0j Any empty sequence eg:( ),[ ], Any empty mapping eg: { } www.gvkcv.in
  • 32. The or operator combines two expressions,which make it operands.The or operator works in these ways: ● Relational expressions as operands ● Numbers or strings or lists as operands The or operator
  • 33. Relational expressions as operands: The or operator evaluates to true if either of its (relational) operands evaluates to True;False if both operands evaluate to False. Eg: (4==4) or (5==8) results into True because first expression is True 5>8 or 5<2 results into False because both expressions are False
  • 34. Numbers / Strings / list as operands: In an expression x or y , if first operand has False then return second operand y as result. Eg: 0 or 0 0 First expression is false so second expression is returned 0 or 8 8 First expression is false so second expression is returned 8 or 0 8 First expression is true hence first expression is returned “Gvkcv” or “ ” “Gvkcv” First expression is true hence first expression is returned “ “ or “gvkcv” “gvkcv” First expression is false hence second expression is returned “ “ or “ “ “ “ First expression is false hence second expression is returned “Python” or “gvkcv” “Python” First expression is true hence first expression is returned
  • 35. The and operator: ● Relational expressions as operands ● Numbers or strings or lists as operands
  • 36. Relational expressions as operands: The and operator evaluates to True if both of its operands evaluate to True ; False if either or both operands evaluate to False. Eg: (7==7) and (5==7) results False (2>5) and (5<2) results False 5>2 and 2<5 results True
  • 37. Numbers or Strings or Lists as operands: In an expression x and y , if first operand has false then return first operand otherwise return second operand. Eg: 0 and 0 0 First expression is false so second expression is returned 0 and 8 0 First expression is false so second expression is returned 8 and 0 0 First expression is true hence first expression is returned “Gvkcv” and “ ” “” First expression is true hence first expression is returned “ “ and “gvkcv” “” First expression is false hence second expression is returned “ “ and “ “ “ “ First expression is false hence second expression is returned “Python” and “gvkcv” “gvkcv” First expression is true hence first expression is returned
  • 38. The not operator: The logical not operator negates or reverse the truth value of the expression. Eg: not 5 results into true not 0 results into true not -4 results into false