SlideShare a Scribd company logo
Python Programming
Unit – III (Part IV)
(Lecture 23)
Lists
Python Programming
Unit – III (Part IV)
(Lecture 23)
Lists
List is a sequence Lists are mutable Traversing a list
Lists
Lecture 23
List is a sequence
Lists are mutable List slices
List methods
List operations
Traversing a list
Deleting elements
Lists and Strings
Map filter &
reduce
Aliasing
List arguments
Objects and
values
Lecture 25
Lecture 24
Lecture 26
Lists
Lecture 23
List is a sequence
Lists are mutable
Traversing a list
List is a sequence
• List is a sequence of
elements (items) of
any type.
• Create a new list by
using [ ] .
Lists
Lecture 23
List is a sequence
Lists are mutable
Traversing a list
Lists are mutable
• Unlike strings, lists are
mutable.
• Index is applied same as
strings.
Lists
Lecture 23
List is a sequence
Lists are mutable
Traversing a list
Traversing a list
• Traverse the elements of a
list using for loop.
Lists
Lecture 23
List is a sequence
Lists are mutable
Traversing a list
Python Programming
Unit – III (Part IV)
(Lecture 24)
Lists
Python Programming
Unit – III (Part IV)
(Lecture 24)
Lists
List slices List methods
List operations
Lists
Lecture 23
List is a sequence
Lists are mutable List slices
List methods
List operations
Traversing a list
Deleting elements
Lists and Strings
Map filter &
reduce
Aliasing
List arguments
Objects and
values
Lecture 25
Lecture 24
Lecture 26
Lists
Lecture 24
List slices
List methods
List operations
List operations
Lists
Lecture 24
List slices
List methods
List operations
List slices
Lists
Lecture 24
List slices
List methods
List operations
List methods
Lists
Lecture 24
List slices
List methods
List operations
Python Programming
Unit – III (Part IV)
(Lecture 25)
Lists
Python Programming
Unit – III (Part IV)
(Lecture 25)
Lists
Deleting elements Lists and Strings
Map, filter &
reduce
Lists
Lecture 23
List is a sequence
Lists are mutable List slices
List methods
List operations
Traversing a list
Deleting elements
Lists and Strings
Map, filter &
reduce
Aliasing
List arguments
Objects and
values
Lecture 25
Lecture 24
Lecture 26
Lists
Deleting elements
Lists and Strings
Map, filter &
reduce
Lecture 25
Map, filter & reduce
my_pets = ['alfred', 'tabitha', 'william', 'arla’]
uppered_pets = []
for pet in my_pets:
pet_ = pet.upper()
uppered_pets.append(pet_)
print(uppered_pets)
my_pets = ['alfred', 'tabitha', 'william', 'arla’]
uppered_pets = list(map(str.upper,my_pets))
print(uppered_pets)
Map, filter & reduce
scores = [66, 90, 68, 59, 76, 60, 88, 74, 81, 65]
def is_A_student(score):
return score > 75
over_75 = list(filter(is_A_student, scores))
print(over_75)
scores = [66, 90, 68, 59, 76, 60, 88, 74, 81, 65]
over_75 = list(filter(lambda x: x >75, scores))
print(over_75)
Map, filter & reduce
from functools import reduce
numbers = [3, 4, 6, 9, 34, 12]
def custom_sum(first, second):
return first + second
result = reduce(custom_sum, numbers)
print(result)
Lists
Deleting elements
Lists and Strings
Map, filter &
reduce
Lecture 25
Deleting elements
Lists
Deleting elements
Lists and Strings
Map, filter &
reduce
Lecture 25
Lists and Strings
To convert from a string to a list of characters, you can
use list.
Lists
Deleting elements
Lists and Strings
Map, filter &
reduce
Lecture 25
Python Programming
Unit – III (Part IV)
(Lecture 26)
Lists
Python Programming
Unit – III (Part IV)
(Lecture 26)
Lists
Aliasing List arguments
Objects and
values
Lists
Lecture 23
List is a sequence
Lists are mutable List slices
List methods
List operations
Traversing a list
Deleting elements
Lists and Strings
Map, filter &
reduce
Aliasing
List arguments
Objects and
values
Lecture 25
Lecture 24
Lecture 26
Lists
Aliasing
List arguments
Objects and
values
Lecture 26
Objects and values
To check whether two variables refer to the same object, you
can use the is operator.
Objects and values
To check whether two variables refer to the same object, you
can use the is operator.
Lists
Aliasing
List arguments
Objects and
values
Lecture 26
Aliasing
Lists
Aliasing
List arguments
Objects and
values
Lecture 26
List arguments
List arguments
Lists
Aliasing
List arguments
Objects and
values
Lecture 26

More Related Content

PPTX
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
PPTX
Machine Learning lecture4(logistic regression)
PPT
Data mining Concepts and Techniques
PPTX
Knn 160904075605-converted
PPTX
Dimensionality reduction: SVD and its applications
PPT
3. mining frequent patterns
PPTX
Linear Discriminant Analysis (LDA)
PPTX
Support vector machine
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Machine Learning lecture4(logistic regression)
Data mining Concepts and Techniques
Knn 160904075605-converted
Dimensionality reduction: SVD and its applications
3. mining frequent patterns
Linear Discriminant Analysis (LDA)
Support vector machine

What's hot (20)

ODP
Machine Learning With Logistic Regression
PDF
Rough sets and fuzzy rough sets in Decision Making
PDF
Graph theory in network system
PPTX
Negative binomial distribution
PDF
Understanding random forests
PPTX
line attributes.pptx
PDF
Bias and variance trade off
PDF
Computer graphics curves and surfaces (1)
PPTX
Binary Class and Multi Class Strategies for Machine Learning
PDF
Naive Bayes Classifier
PDF
Graph Theory: Paths & Cycles
PDF
Decision tree lecture 3
PPTX
Classification in data mining
PPT
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
PPTX
Inductive bias
PPTX
SINGLE VARIABLE OPTIMIZATION AND MULTI VARIABLE OPTIMIZATIUON.pptx
PDF
K means clustering
PPTX
2D Transformation
PDF
Logistic regression in Machine Learning
Machine Learning With Logistic Regression
Rough sets and fuzzy rough sets in Decision Making
Graph theory in network system
Negative binomial distribution
Understanding random forests
line attributes.pptx
Bias and variance trade off
Computer graphics curves and surfaces (1)
Binary Class and Multi Class Strategies for Machine Learning
Naive Bayes Classifier
Graph Theory: Paths & Cycles
Decision tree lecture 3
Classification in data mining
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Inductive bias
SINGLE VARIABLE OPTIMIZATION AND MULTI VARIABLE OPTIMIZATIUON.pptx
K means clustering
2D Transformation
Logistic regression in Machine Learning
Ad

Similar to Python Programming | JNTUA | UNIT 3 | Lists | (20)

PDF
List , tuples, dictionaries and regular expressions in python
PPTX
Unit 4.pptx python list tuples dictionary
PPTX
Lists.pptx
PDF
‘How to develop Pythonic coding rather than Python coding – Logic Perspective’
PPTX
Python Lecture 8
PPTX
Pythonlearn-08-Lists.pptx
PPTX
UNIT-4.pptx python for engineering students
PPTX
11 Introduction to lists.pptx
PDF
PDF
Python revision tour II
PDF
Python-Ukllllllllllllllllllllllllllllnit 2.pdklllllllf
PPTX
UNIT-3 python and data structure alo.pptx
PPTX
Pythonlearn-08-Lists (1).pptxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
PPTX
Python lec2
PDF
Processing data with Python, using standard library modules you (probably) ne...
PDF
beginners_python_cheat_sheet -python cheat sheet description
PPT
White paper on tuples
PPTX
Chapter 15 Lists
PPTX
Lists in Python
PDF
Data type list_methods_in_python
List , tuples, dictionaries and regular expressions in python
Unit 4.pptx python list tuples dictionary
Lists.pptx
‘How to develop Pythonic coding rather than Python coding – Logic Perspective’
Python Lecture 8
Pythonlearn-08-Lists.pptx
UNIT-4.pptx python for engineering students
11 Introduction to lists.pptx
Python revision tour II
Python-Ukllllllllllllllllllllllllllllnit 2.pdklllllllf
UNIT-3 python and data structure alo.pptx
Pythonlearn-08-Lists (1).pptxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Python lec2
Processing data with Python, using standard library modules you (probably) ne...
beginners_python_cheat_sheet -python cheat sheet description
White paper on tuples
Chapter 15 Lists
Lists in Python
Data type list_methods_in_python
Ad

More from FabMinds (20)

PPTX
Python Programming | JNTUA | UNIT 3 | Strings |
PPTX
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
PPTX
Python Programming | JNTUA | UNIT 2 | Case Study |
PPTX
Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
PPTX
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
PPTX
Application layer protocols
PPTX
Internet connectivity
PPTX
Introduction for internet connectivity (IoT)
PPTX
web connectivity in IoT
PPTX
message communication protocols in IoT
PPTX
web communication protocols in IoT
PPTX
introduction for web connectivity (IoT)
PPTX
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
PPTX
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
PPTX
Data enrichment
PPTX
Communication technologies
PPTX
M2M systems layers and designs standardizations
PPTX
Business models for business processes on IoT
PPTX
Python Programming | JNTUK | UNIT 1 | Lecture 5
PPTX
Python Programming | JNTUK | UNIT 1 | Lecture 4
Python Programming | JNTUA | UNIT 3 | Strings |
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
Python Programming | JNTUA | UNIT 2 | Case Study |
Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
Application layer protocols
Internet connectivity
Introduction for internet connectivity (IoT)
web connectivity in IoT
message communication protocols in IoT
web communication protocols in IoT
introduction for web connectivity (IoT)
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
Data enrichment
Communication technologies
M2M systems layers and designs standardizations
Business models for business processes on IoT
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 4

Recently uploaded (20)

PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Complications of Minimal Access Surgery at WLH
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
RMMM.pdf make it easy to upload and study
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Anesthesia in Laparoscopic Surgery in India
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Cell Structure & Organelles in detailed.
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Complications of Minimal Access Surgery at WLH
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Cell Types and Its function , kingdom of life
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Microbial disease of the cardiovascular and lymphatic systems
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
TR - Agricultural Crops Production NC III.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
VCE English Exam - Section C Student Revision Booklet
RMMM.pdf make it easy to upload and study
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf

Python Programming | JNTUA | UNIT 3 | Lists |