What Are Strings?

STEP 1 — What Are Strings? (a.k.a. Text, Dialogue, and Game Personality)

Alright coder, listen up.

Up until now, your game has been thinking, looping, fighting, exploring…

But it hasn’t been talking.

That changes right now.

Strings are how Python handles text — everything from:

  • player names
  • dialogue
  • menus
  • story narration
  • item descriptions
  • dramatic “YOU DIED” messages

If your game needs to say anything, strings are the tool.


1. What Exactly Is a String?

A string is just inside quotes.

name = "Mark"
message = "Welcome to the dungeon."

print(name)
print(message)

Boom.

You’re officially speaking Python.

Click Run

2. Strings Can Hold Anything

Letters? Yes.

Numbers? Yes.

Symbols? Absolutely.

Emojis? Python says “bring it on.”

warning = "Health low!"

print(warning)

Your game now has attitude.

Click Run

3. Strings Are Everywhere in Games

Think about it:

  • “Choose your weapon”
  • “You found a potion!”
  • “Enemy defeated!”
  • “Level up!”

All strings.

All essential.

Without strings, your game is basically a silent film from 1923.


4. Printing Strings

The simplest way to use a string is to print it:

print("Welcome, hero!")
Click Run

This is the “hello world” of game narration.


Practice (Your Turn!)

Mini-Challenge

Create a variable called title that stores the name of your game, then print it.

Modify and Run

Boom.

Your game now has branding.

You now understand:

  • what strings are
  • why they matter
  • how they power every message in your game
  • how to create and print them

Your game officially has a voice.

Ready for Step 2, where we learn how to combine strings, build messages, and make your game talk dynamically?