SlideShare a Scribd company logo
Python Programming
Unit – III (Part II)
(Lecture 19)
Strings
Python Programming
Unit – III (Part II)
(Lecture 19)
Strings
String Sequence String Length String Traversal
Strings
Lecture 19 Lecture 20
String Sequence
String Length Immutable
Searching
String slicing
String Traversal
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
Strings
Lecture 19
String Sequence
String Length
String Traversal
String Sequence
• A string is a sequence
of characters.
• You can access the
characters one at a
time with the [ ]
operator
The expression in brackets is
called an index.
Strings
Lecture 19
String Sequence
String Length
String Traversal
String Length
len is a built-in function
that returns the number
of characters in a string
How to find last character in string?
Strings
Lecture 19
String Sequence
String Length
String Traversal
String Traversal
Start at the beginning, select
each character in turn and
continue until the end is
called a traversal.
Strings
Lecture 19
String Sequence
String Length
String Traversal
Python Programming
Unit – III (Part II)
(Lecture 20)
Strings
Python Programming
Unit – III (Part II)
(Lecture 20)
Strings
Immutable Searching
String slicing
Strings
Lecture 19 Lecture 20
String Sequence
String Length Immutable
Searching
String slicing
String Traversal
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
Strings
Lecture 20
Immutable
Searching
String slicing
String slicing
• A segment of a string is
called a slice.
• The operator [n : m]
returns from the nth
char to the (m-1)th char
Strings
Lecture 20
Immutable
Searching
String slicing
Immutable
Strings are immutable,
which means you can’t
change an existing string.
Strings
Lecture 20
Immutable
Searching
String slicing
Searching
• It takes a character and finds
the index where that character
appears.
• If the character is not found,
the function returns -1
Strings
Lecture 20
Immutable
Searching
String slicing
Python Programming
Unit – III (Part II)
(Lecture 21)
Strings
Python Programming
Unit – III (Part II)
(Lecture 21)
Strings
Looping &
Counting
String methods in operator String Comparison
Strings
Lecture 19 Lecture 20
String Sequence
String Length Immutable
Searching
String slicing
String Traversal
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
Strings
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
Looping & Counting
Strings
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
String methods
• A method is similar to a
function.
• It takes arguments and
returns a value
Strings
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
in operator
• The word in is a Boolean
operator that takes two
strings.
• if the first string appears
as a substring in the
second: returns True
Strings
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
String Comparison
Strings
String methods
in operator
Looping &
Counting
String Comparison
Lecture 21
Python Programming
Unit – III (Part III)
(Lecture 22)
Case Study
Lecture 22
Reading word lists
Search
Looping with
indices
Case Study
Reading word lists
Lecture 22
Reading word lists
Search
Looping with
indices
Case Study
Search
Search
Lecture 22
Reading word lists
Search
Looping with
indices
Case Study
Looping with indices
L E V E L
Lecture 22
Reading word lists
Search
Looping with
indices
Case Study

More Related Content

PPT
Naive String Matching Algorithm | Computer Science
PDF
Polynomials in scilab
DOCX
Tests
PPT
String Matching with Finite Automata,Aho corasick,
PPTX
Brute force method
DOCX
Question bank toafl
PDF
Oop sample ktu
PDF
Pratik aasigement
Naive String Matching Algorithm | Computer Science
Polynomials in scilab
Tests
String Matching with Finite Automata,Aho corasick,
Brute force method
Question bank toafl
Oop sample ktu
Pratik aasigement

What's hot (10)

PDF
Java and Data Structure (June - 2014) [Revised Course | Question Paper]
PPT
Model and Design
PPTX
Towards advanced data retrieval from learning objects repositories
PPTX
Boyer moore algorithm
PPT
Perform brute force
 
PDF
Lec12-CS110 Computational Engineering
PPT
04 brute force
PPTX
finite automata
PPTX
Strings numbers prints
PDF
String matching, naive,
Java and Data Structure (June - 2014) [Revised Course | Question Paper]
Model and Design
Towards advanced data retrieval from learning objects repositories
Boyer moore algorithm
Perform brute force
 
Lec12-CS110 Computational Engineering
04 brute force
finite automata
Strings numbers prints
String matching, naive,
Ad

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

PDF
BCSE101E_Python_Module5 (4).pdf
PPT
Unit-I-PPT-1.ppt
PPTX
Introduction To Programming with Python-3
PPT
Java Strings methods and operations.ppt
PPTX
STRINGS_IN_PYTHON 9-12 (1).pptx
PPTX
trisha comp ppt.pptx
PDF
0-Slot21-22-Strings.pdf
PPTX
ecFDkQifGYWkHLXQ395.pptxbbbbngvbngrrghxcvvb
PDF
Python Strings Methods
PPTX
Engineering CS 5th Sem Python Module -2.pptx
PDF
ppt notes python language operators and data
PPTX
Python strings presentation
PDF
String.pdf
PPTX
1. PGA2.0-Python Programming-Intro to Python.pptx
PPTX
unit1 python.pptx
PPTX
Multidimensional Lists and Fuctions in python
PPTX
C# Strings
PPTX
PROGRAMMING FOR PROBLEM SOLVING FOR STRING CONCEPT
DOCX
Python Course outline.docx
BCSE101E_Python_Module5 (4).pdf
Unit-I-PPT-1.ppt
Introduction To Programming with Python-3
Java Strings methods and operations.ppt
STRINGS_IN_PYTHON 9-12 (1).pptx
trisha comp ppt.pptx
0-Slot21-22-Strings.pdf
ecFDkQifGYWkHLXQ395.pptxbbbbngvbngrrghxcvvb
Python Strings Methods
Engineering CS 5th Sem Python Module -2.pptx
ppt notes python language operators and data
Python strings presentation
String.pdf
1. PGA2.0-Python Programming-Intro to Python.pptx
unit1 python.pptx
Multidimensional Lists and Fuctions in python
C# Strings
PROGRAMMING FOR PROBLEM SOLVING FOR STRING CONCEPT
Python Course outline.docx
Ad

More from FabMinds (20)

PPTX
Python Programming | JNTUA | UNIT 3 | Lists |
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
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
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
Python Programming | JNTUA | UNIT 3 | Lists |
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
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Data enrichment
Communication technologies
M2M systems layers and designs standardizations
Business models for business processes on IoT
Python Programming | JNTUK | UNIT 1 | Lecture 5

Recently uploaded (20)

PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Pharma ospi slides which help in ospi learning
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
master seminar digital applications in india
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Basic Mud Logging Guide for educational purpose
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharma ospi slides which help in ospi learning
O5-L3 Freight Transport Ops (International) V1.pdf
VCE English Exam - Section C Student Revision Booklet
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Week 4 Term 3 Study Techniques revisited.pptx
Final Presentation General Medicine 03-08-2024.pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
O7-L3 Supply Chain Operations - ICLT Program
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Types and Its function , kingdom of life
master seminar digital applications in india
Renaissance Architecture: A Journey from Faith to Humanism
Basic Mud Logging Guide for educational purpose
TR - Agricultural Crops Production NC III.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf

Python Programming | JNTUA | UNIT 3 | Strings |