GCGrowCarrer

Strings

Locked

Lesson 3 of 60 · Syntax · Easy

Finish these first:Variables and Types →Or pass the tests below to unlock it now.

1

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.
Key words (tap to learn):
2

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).

3

Quick check

How do you tell Python that a value is text (a string) instead of a variable name?

4

Your challenge

2 sample tests, 1 hidden

Create a variable named greeting and store the text "Hello" inside it (type greeting = "Hello").

Stuck? Get a hint (free)
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.

Mastery0%

Learn this first