Python for Data Analytics • Lesson 5
Strings & String Operations
Learn how Python stores and works with text using strings. Practice creating strings, joining text, repeating strings, finding characters and measuring string length.
0 of 8 concepts completed
Complete the activity and related MCQ to unlock the next concept.
What Is a String?
A string is a sequence of characters used to represent text. Names, cities, product names and email addresses are all stored as strings.
Learn by Seeing
Text values in quotes
"Hello" "Vista Academy" "Python" "Dehradun"
Anything inside quotes is text, so Python treats it as a string.
Click any value — see its type:
type
str
Quotes make this text.
Interactive Activity
Which of these is a Python string?
Hint: Strings are wrapped in quotes.
Python Analyst Mindset
Text is half the data you'll ever touch
Names, cities, categories, status codes — almost every analytical dataset is half text. Being fluent with strings is what lets you clean, join and shape them without ever leaving Python.
Store
Put text in variables.
Join
Concatenate with +.
Measure
len() and indexing.
Convert
str() when mixing types.
Frequently Asked Questions
Strings — FAQs
Yes. Both produce a str. Pick one style and stay consistent.
No. You must include the space yourself, e.g. " " between the parts.
Yes. Every character, including spaces and punctuation, counts toward the length.
Python raises an IndexError. Valid indexes go from 0 to len-1 (or -1 to -len).
Lesson Summary
What you learned
Text values wrapped in single or double quotes.
Joins two strings; spaces must be added explicitly.
Repeats the string N times.
len() counts characters; [i] reads the character at index i (starting at 0).
-1 is the last character; -2 the second-to-last, etc.
Convert a number to a string before concatenating.