liveBook · Manning

Empty string

An empty string is a string value containing zero characters.

How 3 Manning books explain it

Python Workout: 50 ten-minute exercises

An empty string is a string containing zero characters.

How it is used
Uses zero-character strings to represent blank user input, terminate loops, join text without separators, and suppress added newlines.
How deep it goes
Defines the value, explains its false conditional behavior, and demonstrates input, looping, joining, and output formatting without covering string internals.
Examples
Demonstrates blank input, restaurant ordering, Ubbi Dubbi output, and printing file lines without doubled newlines.
What you can do after
Apply empty-string tests to interactive loops and choose empty-string arguments for controlled joining and printing.

Read how Python Workout: 50 ten-minute exercises explains empty string →

Tiny Python Projects: Learn coding and testing with puzzles and games

An empty string is a string value containing no characters.

How it is used
Uses the empty string to initialize text accumulators, select conditional values, and suppress trailing newlines.
How deep it goes
Defines the value and demonstrates initialization, concatenation, and output control, but does not examine string internals.
Examples
Demonstrates text transformation, article selection, and verse generation using empty strings or lists as initial accumulators.
What you can do after
Apply empty strings to build text incrementally and control print() endings in Python programs.

Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains empty string →

Learn AI-Assisted Python Programming, Second Edition

An empty string is a string value containing zero characters.

How it is used
Uses empty strings to remove unwanted characters and represent zero-character results in edge-case tests.
How deep it goes
Defines notation and demonstrates replacement and testing, without descending into string internals.
Examples
Demonstrates phone-number cleaning and longest_word(['', '']) returning ''.
What you can do after
Apply empty strings through replace() and include them when testing edge-case behavior.

Read how Learn AI-Assisted Python Programming, Second Edition explains empty string →

Also covered in

What to know first

Related concepts

Questions about empty string

What is empty string?

An empty string is a string value containing zero characters.

Which Manning books explain empty string?

Python Workout: 50 ten-minute exercises, Tiny Python Projects: Learn coding and testing with puzzles and games and Learn AI-Assisted Python Programming, Second Edition.

What should I know before learning empty string?

Manning books that teach empty string usually introduce integer, string, boolean and false first.

What is the difference between empty string and missing value?

An empty string is a string value containing zero characters. A missing value is an expected data value or observation that is absent, unavailable, unknown, or inapplicable.

What is empty string a kind of?

Empty string is a kind of string. A string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.