Strings
LockedLesson 3 of 60 · Syntax · Easy
Finish these first:Variables and Types →Or pass the tests below to unlock it now.
The big idea
A string is how Python stores text — words, names, messages, or even a single letter. To make a string, wrap the text in either double quotes "..." or single quotes '...': Letters are case-sensitive, so "Hello" and "hello" are different strings.
Think of it like this: Think of a string like beads threaded onto a piece of string: each letter is one bead, kept in order inside quotes.
Read the lesson
A string is how Python stores text — words, names, messages, or even a single letter.
To make a string, wrap the text in either double quotes "..." or single quotes '...':
city = "Tokyo"
pet = 'Milo'
message = "Welcome back!"
Letters are case-sensitive, so "Hello" and "hello" are different strings. You can join two strings together with + or check how many characters a string has with len(city).
Quick check
How do you tell Python that a value is text (a string) instead of a variable name?
Your challenge
Create a variable named greeting and store the text "Hello" inside it (type greeting = "Hello").
More learning tools(compare languages, visual guide, related lessons)
Compare with another language
Similar to javascript.strings (86% overlap). UTF-8 string manipulation: template literals in JS, std::string in C++, immutable strings in Go, &str/String in Rust.
Visual walkthrough
A diagram, a step-by-step animation, and short captions for Strings.
Learn this first
- Variables and TypesNot yet