SlideShare a Scribd company logo
Copyright © Cognitior www.cognitior.com
Introductionto
DataScience
Copyright © Cognitior www.cognitior.com
Copyright © Cognitior www.cognitior.com
Copyright © Cognitior www.cognitior.com
Copyright © Cognitior www.cognitior.com
https://www.youtube.com/watch?v=d0QVHmyc_AM
Copyright © Cognitior www.cognitior.com
TypesofVariables
What is your name?
• Chitti
What is your age?
• 33
How many days will we take to learn Python?
• 27.5
Will you help us in learning Python?
• True
Copyright © Cognitior www.cognitior.com
PythoncollectionDatatypes
Lists
Tuples
Dictionaries
Sets
Copyright © Cognitior www.cognitior.com
Lists
Lists
• Mutable
• To hold sequence of values like Age, Gender etc
• To create lists we need square brackets
Creating Lists
Accessing Lists
Slicing Lists
Reassigning Lists
Deleting elements from Lists
Multidimensional Lists
Concatenation of Lists
Operation on Lists
Iteration on a Lists
List comprehension
Built-in functions
Built-in Methods
Copyright © Cognitior www.cognitior.com
Lists
10 20 30 35 40 45 20
0 1 2 3 4 5 6
-7 -6 -5 -4 -3 -2 -1
Index
Reverse Index
Tuples
• Immutable
• Same as List but cannot change the values
• To create Tuples we need normal brackets
Copyright © Cognitior www.cognitior.com
Tuples
Creating Tuples
Accessing Tuples
Slicing Tuples
Deleting Tuples
Reassigning Tuples
Functions on Tuples
Methods on Tuples
Operations on Tuples
Iterating on a Tuple
Nested Tuples
Dictionary
• Key Value Pair
• Words and Meanings, Customer and products, Students and Subjects
• To create dictionary we use curly brackets and colon sign
Copyright © Cognitior www.cognitior.com
Tuples
Creating Dictionaries
Accessing Dictionaries
Reassigning Dictionaries
Deleting Dictionaries
Nested Dictionary
In-built Functions on Dictionaries
In-built Methods on Dictionaries
Operations on Dictionaries
Iterating on a Dictionary
Sets
• Holds sequence of unique values
• Does not support indexing
• To create sets we use curly brackets
Copyright © Cognitior www.cognitior.com
Sets
Creating Sets
Accessing Sets
Updating Sets
Deleting Sets
In-built Functions on Sets
In-built Methods on Sets
Operations on Sets
Iterating on a Set
For Loops
• The range() function
• Iterating on lists or similar constructs
• Iterating on the indices of the lists or similar constructs
• Else statement for for-loops
Copyright © Cognitior www.cognitior.com
LoopsinPython
2000 3445 4335 4444
230 211 222 453
Sales
Profit
While
Loops
• An infinite loop
• The else statement for while loop
• Single statement while
Copyright © Cognitior www.cognitior.com
LoopsinPython
Thankyou!!!
Anyquestions?
support@cognitior.com
Copyright © Cognitior www.cognitior.com

More Related Content

Similar to Data Science and Basics of Python

Ontology Web Services
Ontology Web ServicesOntology Web Services
Ontology Web Services
Trish Whetzel
 
Analysing Learning Through Mediawiki
Analysing Learning Through MediawikiAnalysing Learning Through Mediawiki
Analysing Learning Through Mediawiki
Simon Knight
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Return on Intelligence
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Return on Intelligence
 
Implementing a Taxonomy in a Content Management Portal
Implementing a Taxonomy in a Content Management PortalImplementing a Taxonomy in a Content Management Portal
Implementing a Taxonomy in a Content Management Portal
Access Innovations, Inc.
 
How to Jump Start Taxonomy Content Creation webinar slides 9 24 15
How to Jump Start Taxonomy Content Creation webinar slides 9 24 15How to Jump Start Taxonomy Content Creation webinar slides 9 24 15
How to Jump Start Taxonomy Content Creation webinar slides 9 24 15
Alicia Harapko
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
Mohammed Safwat Abu Kwaik
 
AI open tools for Research.pptx
AI open tools for Research.pptxAI open tools for Research.pptx
AI open tools for Research.pptx
Mohammad Usman
 
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
Joaquin Delgado PhD.
 
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
 RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning... RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
S. Diana Hu
 
H2O World - Clustering & Feature Extraction on Text - Seth Redmore
H2O World - Clustering & Feature Extraction on Text - Seth RedmoreH2O World - Clustering & Feature Extraction on Text - Seth Redmore
H2O World - Clustering & Feature Extraction on Text - Seth Redmore
Sri Ambati
 
Contributions to the World of eScience from the Royal Society of Chemistry
Contributions to the World of eScience from the Royal Society of ChemistryContributions to the World of eScience from the Royal Society of Chemistry
Contributions to the World of eScience from the Royal Society of Chemistry
US Environmental Protection Agency (EPA), Center for Computational Toxicology and Exposure
 
ALA Midwinter 2011 Holdings Update
ALA Midwinter 2011 Holdings UpdateALA Midwinter 2011 Holdings Update
ALA Midwinter 2011 Holdings Update
Crossref
 
Dictionaries in Python
Dictionaries in PythonDictionaries in Python
Dictionaries in Python
Md. Shafiuzzaman Hira
 
Federated to library discovery platfoms
Federated to library discovery platfomsFederated to library discovery platfoms
Federated to library discovery platfoms
Nikesh Narayanan
 
Lavacon preso-2015-miranda-meyers
Lavacon preso-2015-miranda-meyersLavacon preso-2015-miranda-meyers
Lavacon preso-2015-miranda-meyers
Joe Meyers
 
Corporate blogging
Corporate bloggingCorporate blogging
Corporate blogging
difuzr
 
Building OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web toolsBuilding OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web tools
Melanie Courtot
 
Software Programming with Python II.pptx
Software Programming with Python II.pptxSoftware Programming with Python II.pptx
Software Programming with Python II.pptx
GevitaChinnaiah
 
Visually Exploring Patent Collections for Events and Patterns
Visually Exploring Patent Collections for Events and PatternsVisually Exploring Patent Collections for Events and Patterns
Visually Exploring Patent Collections for Events and Patterns
Xiaoyu Wang
 

Similar to Data Science and Basics of Python (20)

Ontology Web Services
Ontology Web ServicesOntology Web Services
Ontology Web Services
 
Analysing Learning Through Mediawiki
Analysing Learning Through MediawikiAnalysing Learning Through Mediawiki
Analysing Learning Through Mediawiki
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Implementing a Taxonomy in a Content Management Portal
Implementing a Taxonomy in a Content Management PortalImplementing a Taxonomy in a Content Management Portal
Implementing a Taxonomy in a Content Management Portal
 
How to Jump Start Taxonomy Content Creation webinar slides 9 24 15
How to Jump Start Taxonomy Content Creation webinar slides 9 24 15How to Jump Start Taxonomy Content Creation webinar slides 9 24 15
How to Jump Start Taxonomy Content Creation webinar slides 9 24 15
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
AI open tools for Research.pptx
AI open tools for Research.pptxAI open tools for Research.pptx
AI open tools for Research.pptx
 
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
 
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
 RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning... RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
 
H2O World - Clustering & Feature Extraction on Text - Seth Redmore
H2O World - Clustering & Feature Extraction on Text - Seth RedmoreH2O World - Clustering & Feature Extraction on Text - Seth Redmore
H2O World - Clustering & Feature Extraction on Text - Seth Redmore
 
Contributions to the World of eScience from the Royal Society of Chemistry
Contributions to the World of eScience from the Royal Society of ChemistryContributions to the World of eScience from the Royal Society of Chemistry
Contributions to the World of eScience from the Royal Society of Chemistry
 
ALA Midwinter 2011 Holdings Update
ALA Midwinter 2011 Holdings UpdateALA Midwinter 2011 Holdings Update
ALA Midwinter 2011 Holdings Update
 
Dictionaries in Python
Dictionaries in PythonDictionaries in Python
Dictionaries in Python
 
Federated to library discovery platfoms
Federated to library discovery platfomsFederated to library discovery platfoms
Federated to library discovery platfoms
 
Lavacon preso-2015-miranda-meyers
Lavacon preso-2015-miranda-meyersLavacon preso-2015-miranda-meyers
Lavacon preso-2015-miranda-meyers
 
Corporate blogging
Corporate bloggingCorporate blogging
Corporate blogging
 
Building OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web toolsBuilding OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web tools
 
Software Programming with Python II.pptx
Software Programming with Python II.pptxSoftware Programming with Python II.pptx
Software Programming with Python II.pptx
 
Visually Exploring Patent Collections for Events and Patterns
Visually Exploring Patent Collections for Events and PatternsVisually Exploring Patent Collections for Events and Patterns
Visually Exploring Patent Collections for Events and Patterns
 

More from Rahul Tiwari

Association rule Intuition
Association rule  IntuitionAssociation rule  Intuition
Association rule Intuition
Rahul Tiwari
 
Outlier treatment
Outlier treatmentOutlier treatment
Outlier treatment
Rahul Tiwari
 
Missing value treatment
Missing value treatmentMissing value treatment
Missing value treatment
Rahul Tiwari
 
Feature scaling
Feature scalingFeature scaling
Feature scaling
Rahul Tiwari
 
Encoding
EncodingEncoding
Encoding
Rahul Tiwari
 
Clustering intuition
Clustering intuitionClustering intuition
Clustering intuition
Rahul Tiwari
 
Classification intuition
Classification   intuitionClassification   intuition
Classification intuition
Rahul Tiwari
 
Regression intuition
Regression intuitionRegression intuition
Regression intuition
Rahul Tiwari
 
Why Data visualization and types of charts
Why Data visualization and types of chartsWhy Data visualization and types of charts
Why Data visualization and types of charts
Rahul Tiwari
 

More from Rahul Tiwari (9)

Association rule Intuition
Association rule  IntuitionAssociation rule  Intuition
Association rule Intuition
 
Outlier treatment
Outlier treatmentOutlier treatment
Outlier treatment
 
Missing value treatment
Missing value treatmentMissing value treatment
Missing value treatment
 
Feature scaling
Feature scalingFeature scaling
Feature scaling
 
Encoding
EncodingEncoding
Encoding
 
Clustering intuition
Clustering intuitionClustering intuition
Clustering intuition
 
Classification intuition
Classification   intuitionClassification   intuition
Classification intuition
 
Regression intuition
Regression intuitionRegression intuition
Regression intuition
 
Why Data visualization and types of charts
Why Data visualization and types of chartsWhy Data visualization and types of charts
Why Data visualization and types of charts
 

Recently uploaded

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
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
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
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
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
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
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
 

Recently uploaded (20)

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
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
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
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
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
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
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
 

Data Science and Basics of Python

  • 1. Copyright © Cognitior www.cognitior.com Introductionto DataScience
  • 2. Copyright © Cognitior www.cognitior.com
  • 3. Copyright © Cognitior www.cognitior.com
  • 4. Copyright © Cognitior www.cognitior.com
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Copyright © Cognitior www.cognitior.com https://www.youtube.com/watch?v=d0QVHmyc_AM
  • 11.
  • 12.
  • 13. Copyright © Cognitior www.cognitior.com TypesofVariables What is your name? • Chitti What is your age? • 33 How many days will we take to learn Python? • 27.5 Will you help us in learning Python? • True
  • 14. Copyright © Cognitior www.cognitior.com PythoncollectionDatatypes Lists Tuples Dictionaries Sets
  • 15. Copyright © Cognitior www.cognitior.com Lists Lists • Mutable • To hold sequence of values like Age, Gender etc • To create lists we need square brackets Creating Lists Accessing Lists Slicing Lists Reassigning Lists Deleting elements from Lists Multidimensional Lists Concatenation of Lists Operation on Lists Iteration on a Lists List comprehension Built-in functions Built-in Methods
  • 16. Copyright © Cognitior www.cognitior.com Lists 10 20 30 35 40 45 20 0 1 2 3 4 5 6 -7 -6 -5 -4 -3 -2 -1 Index Reverse Index
  • 17. Tuples • Immutable • Same as List but cannot change the values • To create Tuples we need normal brackets Copyright © Cognitior www.cognitior.com Tuples Creating Tuples Accessing Tuples Slicing Tuples Deleting Tuples Reassigning Tuples Functions on Tuples Methods on Tuples Operations on Tuples Iterating on a Tuple Nested Tuples
  • 18. Dictionary • Key Value Pair • Words and Meanings, Customer and products, Students and Subjects • To create dictionary we use curly brackets and colon sign Copyright © Cognitior www.cognitior.com Tuples Creating Dictionaries Accessing Dictionaries Reassigning Dictionaries Deleting Dictionaries Nested Dictionary In-built Functions on Dictionaries In-built Methods on Dictionaries Operations on Dictionaries Iterating on a Dictionary
  • 19. Sets • Holds sequence of unique values • Does not support indexing • To create sets we use curly brackets Copyright © Cognitior www.cognitior.com Sets Creating Sets Accessing Sets Updating Sets Deleting Sets In-built Functions on Sets In-built Methods on Sets Operations on Sets Iterating on a Set
  • 20. For Loops • The range() function • Iterating on lists or similar constructs • Iterating on the indices of the lists or similar constructs • Else statement for for-loops Copyright © Cognitior www.cognitior.com LoopsinPython 2000 3445 4335 4444 230 211 222 453 Sales Profit
  • 21. While Loops • An infinite loop • The else statement for while loop • Single statement while Copyright © Cognitior www.cognitior.com LoopsinPython